Repeat your last shell command.
Shell alias for last command.
Typing two exclamation marks at the command prompt '!!' is an alias for the last command, and is real useful if you forget to type sudo after typing some long command.
Example:
''' shell
$ mv './foo' '/some/place/root/owns/bar'
# you forgot to type sudo
$ sudo !! <CR> #<CR> == hitting enter.
#produces
$ sudo mv './foo' '/some/place/root/owns/bar'
'''
'
Written by Adam Bedell
Related protips
1 Response
How did I not know about this? Sheesh, what a great time-saver!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#