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

Unix/Linux
怎样设置一个档案来作为 linux 的转换空间?
全文替换以修改档案方法
如何删除档案中的重复的行
/dev下 cua*被删除,该如何恢复?
/dev/tty0不见了怎麽救回来?
Linux 网管 123 --- 第4章. 安装及硬体组态 - 2.启动 Linux 安装
Linux 网管 123 --- 第4章. 安装及硬体组态 - 3.分割硬碟机
Linux 网管 123 --- 第4章. 安装及硬体组态 - 4.设定Swap格式化Pa
Linux 网管 123 --- 第4章. 安装及硬体组态 - 5.选择想要安装的套件
Linux 网管 123 --- 第4章. 安装及硬体组态 - 6.硬体组态
Linux 网管 123 --- 第4章. 安装及硬体组态 - 7.从 LILO 启动
Linux 网管 123 --- 第4章. 安装及硬体组态 - 8.下载及安装 Red H
Linux 网管 123 --- 第5章. 组态 X Window 系统 -1.使用 X-
Linux 网管 123 --- 第5章. 组态 X Window 系统 -2.使用 X
Linux 网管 123 --- 第5章. 组态 X Window 系统 -3.改善X下的
Linux 网管 123 --- 第5章. 组态 X Window 系统 -4.选择 X
Linux 网管 123 --- 第5章. 组态 X Window 系统 -5.GNOME
Linux 网管 123 --- 第5章. 组态 X Window 系统 -6.KDE 的
Linux 网管 123 --- 第6章. 一般系统管理问题 -1.Root 帐号
Linux 网管 123 --- 第6章. 一般系统管理问题 -2.建立使用者帐号

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-04-20   浏览: 466 ::
收藏到网摘: 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的步骤,又可以使命令很清楚了。