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

Unix/Linux
linux 操作技巧收集_
linux下如何读取使用iso 镜像文件的方法
Linux平台下文件的压缩与解压参数说明
Linux下常用压缩格式的压缩与解压方法
Linux JDK,TOMCAT安装及环境设置
Linux sleep命令使用参数
Linux cat命令参数
nfs 配置的简单例子
linux kill 关闭进程命令
linux ultrasphinx Anonymous modules have no name to be referenced by
Linux oracle 9i图文安装方法一
Linux oracle 9i图文安装教程二
Linux oracle 9i图文安装教程三
Linux oracle 9i图文安装教程四
Linux oracle 9i图文安装教程五
Linux oracle 9i图文安装教程六 完结篇
linux AS3 oracle9i 安装指南
Linux 下 (RedHat 9.0) JDK,Tomcat,MySQL的安装
RedHat 9.0下Apache+PHP+MySQL服务器安装配置
Linux 下用 Python 连接 MSSql Server 2008

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


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