Copy previous command into current
When you use a double quotation mark in a shell command, it's replaced with whatever your previous command was. This is very useful when you need to execute the previous command, but prefixed with sudo
, for example.
$ /etc/init.d/apache2 restart
Permission denied
$ sudo !!
Hooray!
Written by Willem van der Jagt
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Related Tags
#shell
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#