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

Unix/Linux
RHEL 5服务器系统下故障处理方法
Linux系统下图形界面更改IP地址
Linux操作系统下禁止单用户模式登录的操作方法
Linux中QQ软件的安装和配置
linux 操作系统 uniq命令的说明和使用
Linux 上如何使用QQ和MSN工具
The file /boot/grub/stage1 not read cor 解决办法
如何修改apache 2最大连接数
4G内存时linux的mtrr表不正确的解决
制作Linux的U盘(usb)启动盘
Linux Telnet登录慢问题解决
LINUX操作系统死机解决办法
linux的3种引导方法
vi编辑器使用技巧
Linux使用的一些基本问题
Linux系统下使用wine运行迅雷5的方法
startx启动图形界面失败的几个解决方法
Red Hat Enterprise Linux AS4( 企业版4.0下载)
Raid的学习和基础知识
Linux 下如何配置 PHP 支援 GD

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


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