标签:history
vim /etc/profile
export HISTORY_FILE=/tmp/history/`date +%Y%m%d`-history.log
if [ ! -f /tmp/history/`date +%Y%m%d`-history.log ]; then
mkdir -p /tmp/history
chmod 777 -R /tmp/history
touch /tmp/history/`date +%Y%m%d`-history.log
chmod 777 /tmp/history/`date +%Y%m%d`-history.log
fi
export PROMPT_COMMAND=‘{ date "+%Y-%m-%d %T $(who am i |awk "{print \$1\" \"\$2\" \"\$5}") $(id | awk "{print \$1}") $(pwd | awk "{print \$1}") # $(history 1 | { read x cmd; echo "$cmd"; })"; } >> $HISTORY_FILE‘
标签:history
原文地址:http://leomars.blog.51cto.com/683246/1614717