即時生效,當下
export HISTTIMEFORMAT="%Y-%m-%dT%T="
或,每次登入生效
echo 'export HISTTIMEFORMAT="%Y-%m-%dT%T="' >> ~/.bash_profile
又或者把它記錄到 /var/log/messages 裡
echo "export PROMPT_COMMAND='{ command=\$(history 1 | { read x y; echo \$y; }); logger -p local1.notice -t bash -i \"user=\$USER,from=\$SSH_CLIENT,pwd=\$PWD,command:\$command\"; }'" >> /etc/bashrc
留言