当想知道当前用户都执行了什么命令可以使用命令 history 查看操作历史记录
history运行结果: 应为我清理了一下,所以没那么多记录
[cj@obj ~]$ history
1 history
2 ip a
3 history
[cj@obj ~]$ history -c执行完后可以再执行一下 history 查看是否成功,下图有一个是因为执行了 history 就新添加了一条,但之前都清除了

参数是数字
history -d 2