往往我们操作的每一条命令都会被机器记录下来,所有我们为了安全需要屏蔽掉某些敏感的操作命令。

设置linux默认的历史记录数:

临时生效:

export  HISTSIZE=5

history

history历史记录控制

永久生效:

echo "export HISTSEZE=5" >>/etc/profile

. /etc/profile或者source /etc/profile    //是得配置生效

 history历史记录控制

控制历史记录的文件:命令行的历史记录数量变量

cat ~/.bash_history

history历史记录控制

历史记录文件的命令数量变量(~/.bash_history)

临时生效:

export HISTFILESIZE=5

history

 

永久生效:

echo “HISTFILESIZE=5” >>/etc/profile

. /etc/profile或者source /etc/profile   //是得配置生效

 history历史记录控制

清空历史记录:history –c

 history历史记录控制

清空指定记录命令:

history –d 行号

 history历史记录控制

相关文章:

  • 2022-12-23
  • 2021-06-10
  • 2022-02-12
  • 2022-02-07
  • 2021-11-13
  • 2021-07-11
  • 2021-03-28
  • 2021-05-27
猜你喜欢
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2021-06-24
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案