码迷,mamicode.com
首页 > 其他好文 > 详细

history编写

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

标签: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编写

标签:history

原文地址:http://leomars.blog.51cto.com/683246/1614717

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!