测试必知必会系列- Linux常用命令 - history

21篇测试必备的Linux常用命令,每天敲一篇,每次敲三遍,每月一循环,全都可记住!!

https://www.cnblogs.com/poloyy/category/1672457.html

查看历史命令执行记录 

history 

查看命令mkdir 的历史执行记录 

history | grep mkdir 

执行历史记录中,序号为1015的命令 

!1015

执行上一条命令(直接输入两个感叹号)

!!

查找最后10条历史记录(两种方式)

history 10
history | tail -10

清除历史记录

history -c

将当前所有历史记录写入历史文件中,默认写入 ~/.bash_history 

history -w
cat ~/.bash_history

猜你喜欢

转载自www.cnblogs.com/poloyy/p/12514473.html