echo 'export HISTTIMEFORMAT ="%F %T `who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'` " >> /etc/profile 然后 source /etc/profile 验证下 history