Execute previous commands
You could press the up arrow to cycle through your previous commands,or you could use the history command.
The command will show your previous commands, when you find the one you want, you can call it be typing !xx, where xx is the number of the command.
Written by Alex Mejias
Related protips
2 Responses
You can use the last command with two exclamation marks. It also outputs the full command with the exclamation marks replaced, just to show you. Below is an example with whoami
executed by the user seawolf
:
$ whoami
seawolf
$ sudo !!
sudo whoami
[sudo] password for seawolf: **********
root
over 1 year ago
·
If you press ctrl+R and then start typing you can search in your command history.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Terminal
Authors
Related Tags
#terminal
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#