命令可以查看执行过的历史命令。 其命令格式为:
[root@shell ~]# history[n]
[root@shell ~]# history [-c]
[root@shell ~]# history [-raw] historyfiles
正常情况下,Linux中历史指令的读取和存储过程如下:
history -w
可以强制立刻写入历史指令可以结合以下指令配合:
!number
:执行第number个指令!command
:由最近的指令向前搜寻指令串开头为command的指令,并执行!!
:执行上一个指令