[root@linux ~]# history [n][root@linux ~]# history [-c][root@linux ~]# history [-raw] histfiles参数:n :数字,意思是『要列出最近的 n 笔命令列表』的意思!-c :将目前的 shell 中的所有 history 内容全部消除-a :将目前新增的 history 指令新增入 histfiles 中,若没有加 histfiles ,则预设写入 ~/.bash_history-r :将 histfiles…
# vi ~/.bash_history 清空里面的记录,并退出当前shell # exit(一定要退出当前shell) # history 1 vi ~/.bash_history 2 history |grep mysql 3 clear 4 vi ~/.bash_history 5 echo "" > ~/.bash_history 6 vi ~/.bash_history 7 history 8 exit 9 history #之前的内容被清空!!! [root@loca…
大家都知道Linux平台上,可以通过history命令查看最近所执行过的命令,但history命令默认所显示的只有编号和命令的,只知道命令是最近所执行的,但不知具体执行的日期.时.分.秒,有时给寻找证据带来不便,例如如下显示情况: 352 exit 353 history 354 vi /etc/profile 355 history 下面就来讲一下,如何让history命令显示最近所执行过的命令的具体执行时间. 步骤如下: 1.以ROOT用户编辑/etc/profile文件,在里面加入…