Selectively Deploying your Superpowers on Linux


The sudo command is very handy when you need to run occasional commands with superuser power, but you can sometimes run into problems when it doesn’t do everything you expect it should. Say you want to add an important message at the end of some log file and you try something like this:

$ echo "Important note" >> /var/log/somelog
-bash: /var/log/somelog: Permission denied

OK, it looks like you need to employ some extra privilege. In general, you can’t write to a system log file with your user account. Let’s try that again with sudo.

…The sudo command is meant to allow you to easily deploy superuser access on an as-needed basis, but also to endow users with very limited privileged access when that’s all that is required. 

Read more at Network World