当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > 如何来清除Linux系统命令的历史记录

Unix/Linux
Linux中NE2000兼容网卡的安装
sis650显卡驱动自定义安装终极指南(RH80)
配置好显卡驱动Linux下玩游戏同样爽
linux设备驱动笔记:字符设备驱动
把设备驱动程序编译进嵌入式Linux内核
删除Linux引导界面的方法及注意事项
在Linux操作系统下如何开启硬盘DMA
从Linux BIOS的起源 看未来主板框架
深入浅出 Linux字符设备驱动程序解析
Linux系统启动引导程序配置文件解析
深入浅出 Linux设备驱动异步通知介绍
深入浅出 Linux设备驱动中断处理介绍
新手看招 Linux操作系统的目录结构一览
菜鸟乐园 Linux中常见文件系统格式介绍
Motorola微处理器bootloader分析与应用
实用技巧 Linux系统的经典使用技巧八则
Linux操作系统下IPTables配置方法详解
Linux系统中增加Swap分区文件步骤方法
使用Openssh工具远程管理Solaris 10
uClinux中添加用户应用程序的详细方法

Unix/Linux 中的 如何来清除Linux系统命令的历史记录


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-04-20   浏览: 439 ::
收藏到网摘: n/a

步骤如下:
 
1、建立一个文件来存储常用命令,例如/root/history.txt,把常用命令当成文本写进去,每个命令占一行
 
2、在终端运行history -c,清除杂乱的历史记录
 
3、运行history -r /root/history.txt,把命令读进来作为当前bash的历史记录
 
4、运行history,就得到一个整洁的命令列表了,例如:
 

[root@localhost windata]# history -c [root@localhost windata]# history -r /root/history.txt [root@localhost windata]# history 1 history -r /root/history.txt 2 mount -t msdos -o iocharset=gb2312 /dev/sda1 /mnt/usb 3 mount -t vfat -o iocharset-gb2312 /dev/hda5 /mnt/windata 4 umount /mnt/windata 5 mount -t vfat -o iocharset-gb2312 /dev/hda5 /mnt/windata 6 cd /mnt/windata 7 history [root@localhost windata]#


5、以后命令乱了,重复1-4的步骤,又可以使命令很清楚了。