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

Unix/Linux
Linux 下采用软件实现RAID
汉化你的RedHat全攻略(2)- TrueType字体的使用
汉化你的RedHat全攻略(3)- RedHat 7.0上的中文环境和输入法
汉化你的RedHat全攻略(4)- FAQ和一些总结
Linux与其他操作系统的区别
为什么我用 ipchains 构建的子网里的机器不能用 ftp?
轻轻松松的安装Slackware Linux -- 0.自序,观念篇
Linux命令Man解释:ftpaccess(5) :ftpd 的配置文件
Linux命令Man解释:chsh :更换你登入时所用的shell
Linux命令Man解释:chfn :改变你的finger讯息
Linux命令Man解释:apropos :在whatis资料库中搜寻特定字串
X-Window中如何设置字体
rpm命令参数列表
汉化你的RedHat全攻略(1)- 中文环境和中文输入法的安装
Linux命令Man解释:MIRROR:镜像远端节点上的档案
Linux命令Man解释:losetup :设定与控制loop devices
Linux命令Man解释:lilo :安装引导装载程序
Linux命令Man解释:groupmod :修改组
Linux命令Man解释:shutdown:让系统关机
Linux命令Man解释:SUDO(8):以root身份执行指令

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


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