我们有多个人同时以rootlogin。 如何在login期间或终止会话后查看其命令历史logging。
问候,
我将它们合并在configuration文件中使用:
shopt -s histappend
这通常足以让我在注销后查看会话信息(通过检查历史文件)。 我也有时间戳:
export HISTTIMEFORMAT='%m-%d-%Y %H:%M:%S '
有些人在每个命令之后也设置了历史重新加载和stream行。 我不这样做,但这是这个stream行的秘诀:
# Save and reload the history after each command finishes export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
所有这些都以/etc/bashrc或/etc/profile.d/中的代码片断结束