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

Unix/Linux
Solaris系统性能问题
定时任务
SA299考前简要总结
2005.8.22 310-015考试在TK中出现的原题或类似的题
My sumarization after passing the exam of 310-015
博客序言
SM240 课程内容及学习目标
SA399课程介绍及学习目标
Solaris9的jumpstart服务器配置中文详解(转载自CU)
SA399第一章读书笔记
SA399第二章读书笔记
精灵王的提醒
步长法-解决判断循环链表
SA399第三章读书笔记
真令人惊讶
Solaris介绍(转载)
VxVM中的底层建卷
转: Solaris 10 安装及SVC管理及X及Vmware及其它可能遇到的一些问题
Solaris学习笔记(2)
小型机内存与pc机内存区别

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


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