# 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文件,在里面加入
****打开 vim /etc/profile vim /etc/profile 追加配置 # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). if [ "$PS1" ]; then if [ "$BASH" ] && [ "
导读 如果你登录过 Linux 系统,并敲过一些命令,那你应该知道,bash history 会记录你输入的所有命令.这个操作其实是有一定风险的. 我个人经常使用 Linux,所以我想着研究一番,看看如何隐藏 bash history.下面就是我整理的一些方法,仅供大家参考: · exit normally – history 记录正常写入 · kill– 服务器端运行 -kill bash 进程ID后就不会再记录 history 了.我检查过是否需要加-9参数,不过不用,只需要一个基本的 ki