📅  最后修改于: 2020-12-08 08:47:35             🧑  作者: Mango
与终端交互时,您会经常键入一些命令,有时还会键入带有这些命令的变体。有时可能会很烦人,而且会浪费一些时间。
幸运的是,shell提供了一些命令来重复使用的命令的历史记录。 Shell使我们可以轻松地重复使用所使用的命令。一旦学习了如何有效使用这些命令,您就可以节省大量时间来键入命令。
Command | Function |
---|---|
!! (bang bang) | Repeats last typed command. |
!(one or two letters from starting of command) (bang) | To repeat other commands other than last typed command. |
history | Shows a list of older commands. |
!n | Repeats the command at line number n. |
Ctrl -r (three or four characters from starting of command) | Repeats the mentioned command. |
$HISTSIZE | Determines number of commnds stored in the history. |
$HISTFILE | Displays location of file that contain histoty. |
$HISTFILESIZE | To set numbet of commands stored in history file |