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

Unix/Linux
Linux系统下如何监视系统资源使用率
怎样在Red Hat Linux上使用BIND建立DNS服务器
多点触控技术终于在Linux中实现
中科红旗Linux桌面7.0版引入QtSDK组件
系统启动管理器与GRUB
Linux系统下配置CVS集成cvstrac
解析Linux操作系统下usr的目录结构
Linux系统与Windows系统的线程有何不同
黑客怎样入侵Linux系统
维护inittab配置文件时需要注意的事项
FreeBSD为powerd设置cpu最小工作频率
如何配置Linux才能保证其系统的安全
光驱的软开关与限速简介
新手教程之创建锁文件的方法
双系统计算机怎样卸载其中一个?
运行Linux时的快捷键使用
phpMyAdmin安装方法及介绍
Wine中中文存在很多的乱码怎么解决?
Linux教程:tail命令的巧妙应用
Wget命令来浏览网页的方法

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


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