so I'm looking for a shortcut to automatically fill out the current line with the last executed command, for example, say I executed the ls
command, now my terminal would look a little something like this:
$ >> ls
example.txt important_stuff etc.
$ >>
now I want to type ls again without typing it out manually (useful for long lines of command) so my terminal would look like this:
$ >> ls
example.txt importand_stuff etc.
$ >> ls
what is the shortcut to do this?
CodePudding user response:
You can usually press ↑ (up arrow) key to bring back the last command. You can press this key multiple times to go through your shell history.
The history
command will show you recently executed commands, might be useful too.
CodePudding user response:
Press CTRL P to switch to the last command, and then press CTRL O to execute it