将下列脚本追加到/etc/profile
然后source /etc/profile
就能够在/tmp/dbasky
这个目录下看到所有用户的操作历史
PS1="`whoami`@`hostname`:"'[$PWD]''# '
USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'`
if [ "$USER_IP" = "" ]
then
USER_IP=`hostname`
fi
if [
将下列脚本追加到/etc/profile
然后source /etc/profile
就能够在/tmp/dbasky
这个目录下看到所有用户的操作历史
PS1="`whoami`@`hostname`:"'[$PWD]''# '
USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'`
if [ "$USER_IP" = "" ]
then
USER_IP=`hostname`
fi
if [