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

Unix/Linux
在Linux下成功运行最新的QQ和MSN
轻松搞定RedHat 9命令行(CLI)下看各类图片
建立一个带宽、线程可控的下载型WEB网站
ssh的用户登陆限制
如何给linux添加新硬盘
Linux常见紧急情况处理方法
用 Linux 打造路由器
读核日记(八) --linux的内存管理机制(2)
基于DNS的多机均衡负载的实现
读核日记(四)
读核日记(五)
读核日记(六)
读核日记(七) --linux的内存管理机制(1)
读核日记(三)
如何在RedHat中列出彩色文件
如何同时启动6个X控制台
读核日记(一)
读核日记(二)
Linux与分区
Linux 的带宽管理系统

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


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