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

Unix/Linux
FreeBSD下提高MySQL使用效率
Samba简介
linux技巧:清除U盘病毒的方法
Linux技巧:如何在不摧毁Win系统的情况下体验Linux
linux技巧:修改系统22端口的方法
Linux教程:10条秘诀确保Linux桌面安全性
Linux技巧:介绍两种修改22端口的方法
硬盘安装Puppy Linux 4.0中文版全过程
Linux教程:文件系统基础知识
Linux新手入门教程:教你硬盘挂载方法
如何在双系统下卸载Linux系统
Linux教程:通过管理工具自建防火墙
在Linux系统上编译构建谷歌Chromium浏览器
Linux教程:修改文件权限命令chmod的用法
用Ubuntu自带的FTP服务器vsftpd的一些技巧
Linux教程:设置时间与同步的方法(NTP)
Linux的压缩打包方式之tar命令
Linux中广泛使用的防垃圾邮件技术
在Ubuntu系统中如何对文件进行加密传输
Linux系统防火墙的伪装机制抵抗恶意黑客攻击

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


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