I have been using the terminal for a while now and sometimes (actually, a lot of times) I use a command, like:
cp /etc/test ~/testFolder/
and I get this error:
cp: cannot open `/etc/test` for reading: Permission denied
That's the moment I remember that I forgot the sudo command before it, so I press Up arrow and then CTRL+A to go to the beggining of the line and insert a sudo there:
sudo cp /etc/test ~/testFolder/
There are even worse scenarios where you use vim to edit a file, you forget sudo command and don't see the warning when the program starts, you edit the entire file and in the end, you can't save it!
When you realize you're doing it so many times, it becomes annoying, specially if you're like me and used to type commands without the sudo.
There is a way to solve this problem, when you start the terminal, just type sudo su to use commands as root user, but some say it's more likely to make mistakes that you'll regret forever.
My question is, what's the best practice for executing commands as root? Using sudo and missing it everytime or automatically use sudo bash and having the risk of destroying the entire system?
