Use sudo

1. when you forget to run a command with sudo, instead of retyping the command you could use
# to run the last command in history with sudo
sudo !!
# or you could use if you prefer
sudo !-1
# run the second to the last command in the history with sudo
sudo !-2 
2. To have an interactive shell as root:
sudo -i
# or
sudo su -
3. when you use vim and forget to type sudo
:w !sudo tee %

No comments:

Post a Comment

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...