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

Unix/Linux
renice命令:修改一个正在运行进程的优先权
Linux X-Window配置指南
Linux X-Window显卡配置通用解决方法
主引导扇区释疑
linux磁盘管理命令--du
linux磁盘管理命令--df
Zip Drive Mini-HOWTO
做一个最小的Linux kernel
Linux Shadow-Password-HOWTO - 9. 常问问题及答案
Linux Shadow-Password-HOWTO - 8. 加入 shadow 支援
Linux Shadow-Password-HOWTO - 7. 将 Shadow Sui
Linux Shadow-Password-HOWTO - 5. 安装
Linux命令Man解释:usermod:修改使用者帐号
Linux命令Man解释:userdel:删除使用者帐号及相关档案
Linux命令Man解释:mkdir:创建目录
Linux 的中文化问题简介
Linux命令Man解释:whatis:搜寻特定指令
linux 安装常见的 FAQ 问题 (第二版)
RedHat 7.0 安装 NAT 作法简介
KDE 2.1安装及使用介绍

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


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