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

Unix/Linux
查看linux版本的几条命令
Linux系统常见疑难问题的解决
使用内存作linux下的/tmp临时文件夹
LINUX下防火墙iptables的日志管理
VNC访问时不能切换SCIM输入法的解决办法
Fatal server error: could not open 无法进图形界面的解决办法
在LINUX系统下安装卡巴斯基杀毒网络版
openoffice不能调用SCIM的问题解决方法
Linux服务启动优化
WARNING: /tmp: File system full, swap space limit exceeded的解决办法
在linux系统下让进程在后台运行的方法
Linux 系统关机后电源无法关闭的解决办法
将Red Hat 9.0 CD iso合成一张DVD iso的方法
用YUM升级CentOS下的PHP和MySQL
Linux内核代码英文版构架图
Linux操作系统学习方法小结
用rsync从Linux到Windows远程备份
Linux中的常用符号解释
Linux操作系统提高PHP性能的工具APC
更有效率的使用Linux键盘

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


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