首页 > 其他 > 详细

history环境变量设置

时间:2020-08-10 10:49:55      阅读:103      评论:0      收藏:0      [点我收藏+]
bash环境变量配置文件

全局配置文件:

  • /etc/profile
  • /etc/profile.d/
  • /etc/bashrc
    个人配置文件:
  • ~/.bash_profile
  • ~/.bashrc

history 常用环境变量:

HISTSIZE: 执行history命令输出的行数,默认1000行
HISTFILESIZE: 保存history历史命令文件~/.bash_history最多保存的行数
HISTTIMEFORMAT: 指定执行history命令时显示的时间格式
HISTFILE: 指定存放历史命令的文件,默认是~/.bash_history

范例:
#vi /etc/profile.d/history.sh
HISTTIMEFORMAT="%Y %T:whoami "
#source /etc/profile.d/history.sh
#history
1 2020-08-10 04:43:05:root help history
2 2020-08-10 04:43:33:root history
3 2020-08-10 04:43:36:root history -n

history环境变量设置

原文:https://blog.51cto.com/12233910/2518503

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!