1. 每次系统注销时记录注销时间,将注销前的50条命令记录下来。
- 查看是否有.bash_logout 文件 ll -a
- 编辑该文件,编写内容 vim .bash_logout
whoami >> /logout.txt
date "+%Y-%m-%d %H:%M:%S" >> /logout.txt
history |tail -n 50 >> /history.txt
- exit 退出测试,重新登录,查看根目录/ 下的logout.txt 和 history.txt
- cat /
- cat history.txt
cat logout.txt
image.png