Terminal Timesaver

Forgot to use sudo? It happens to me all the time in Ubuntu. Until a few months ago, I never knew about the !! command. It represents the last command that you have typed in your terminal. Say for instance you have just typed this command:

cp -rf /very/long/path/to/a/file.css /even/longer/path/to/another/destination/

and turns out you don't have permission to do so. Just type

sudo !!

which will execute that last command as a privileged user.

It changed my life!

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.