历史文件换一个位置

history
USER=root
USER_IP=x.x.x.x
if [ "" = "" ]; then
USER_IP=localhost
fi
if [ ! -d /var/log/history ]; then
mkdir /var/log/history
chmod 777 /var/log/history
fi
if [ ! -d /var/log/history/root ]; then
mkdir /var/log/history/root
chmod 300 /var/log/history/root
fi
export HISTSIZE=4096
DT=20180917_11:10:59
export HISTFILE="/var/log/history/root/root@_"
chmod 600 /var/log/history/root/*history* 2>/dev/null

原文地址:https://www.cnblogs.com/gaoyuechen/p/10897816.html