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