#保存一万条命令记录
sed -i 's/^HISTSIZE=1000/HISTSIZE=10000/g' /etc/profile

#在/etc/profile的文件尾部添加如下行数配置信息
######jiagu history xianshi#########
USER_IP=`who -u am i 2>/dev/null | awk '{print $NF}' | sed -e 's/[()]//g'`
if [ "$USER_IP" = "" ]
then
USER_IP=`hostname`
fi
export HISTTIMEFORMAT="%F %T $USER_IP `whoami` "
shopt -s histappend
export PROMPT_COMMAND="history -a"
######### jiagu history xianshi ##########
source /etc/profile

 

相关文章:

  • 2022-12-23
  • 2022-02-18
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-03-05
猜你喜欢
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案