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

Unix/Linux
Linux管理员手册(4)--内存管理
开始进入Linux的知识问答
TCP/IP基础----为Linux做准备(1)
怎样用linux拨号上网
Linux 下文件的压缩、打包与解开
Linux操作系统下的浏览器举要
Linux中的字型(FONTS)设定
用FIPS为LINUX分区
Squid -- Linux下的一个优秀代理服务器软件使用详解
基于Linux的目录服务实现
动手制做自己的Linux启动盘(1)
如何为Linux添加软件详解
LINUX的引导过程
关于Linux下编写和编译程序的几个问题
中文BluePoint Linux 1.0RC 版安装介绍(二)
怎样让你的Linux使用起来更像Windows
Linux下无线上网设置方法
Linux系统下架设CS服务器的完美方法
优化Linux系统硬盘的七个实用技巧
在Linux操作系统中如何截获系统调用

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


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