xport HISTTIMEFORMAT=“[%F %T][`whoami`][${USER_IP}] ”
执行source生效:
source /etc/profile
查看结果:
hadoop@Master:~$ history
1002 [2016-01-11 16:47:37][hadoop][host-e-150.ustcsz.edu.cn] cd 。。/
1003 [2016-01-11 16:47:37][hadoop][host-e-150.ustcsz.edu.cn] du -h --max-depth=1
1004 [2016-01-11 16:47:37][hadoop][host-e-150.ustcsz.edu.cn] du -h --max-depth=2
1005 [2016-01-11 16:47:37][hadoop][host-e-150.ustcsz.edu.cn] sudo find /* -name pokec-relationships
1006 [2016-01-11 16:47:37][hadoop][host-e-150.ustcsz.edu.cn] sudo find /* -name pokec
1007 [2016-01-11 16:47:37][hadoop][host-e-150.ustcsz.edu.cn] sudo find /* -name kddcup
1008 [2016-01-11 16:47:37][hadoop][host-e-150.ustcsz.edu.cn] sudo find /* -name kddcup*
1009 [2016-01-11 16:47:37][hadoop][host-e-150.ustcsz.edu.cn] sudo find /* -name *kddcup*
3.将history记录到log:
#export HISTTIMEFORMAT=“%F %T $USER_IP:`whoami` ”
#export HISTTIMEFORMAT=“%F %T $USER_IP:`whoami` ”
USER_IP=`who -u am i 2》/dev/null(北联网教程,专业提供视频软件下载)
……