首页 > 其他 > 详细

history编写

时间:2015-02-17 23:47:20      阅读:451      评论:0      收藏:0      [点我收藏+]

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

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