The !! command
Hi everyone! I am just figuring out what is the function of the command !! in the bash. It seems it just puts in the command line the command executed just before (in other words, the last executed command), right? What would be its usage if I can do this by just pressing the "up arrow" key?
Tks! |
not all terminals arrow keys work (and especially true for somethings over SSH and stuff)
so, you get neat other solutions, this is also why vim/emacs have cursor moving keys. |
Makes sense ror. Tks!
And you know it the !-2 command has the same function? And what about !-1, does it exist? What for? Tks in advance. |
For -really- anal programmers it's also a shortcut if you have to run the same command a few times in a row; slightly smaller program size (depending on program) typing "!!" in rather than a long and complicated command.
Or ... well, who knows |
yeah it's scriptable unlike the up arrow :)
|
All times are GMT -5. The time now is 10:54 PM. |