Superuser mode

Some actions on the computer require administrative (or superuser) privileges. The name of the superuser is "root". If you list the /etc directory where many of the system configuration files are stored, you'll see that all of them are owned by root.

A superuser has all right and permissions to all programs. In other words, the superuser can do any action on the computer. Working as a root is dangerous since entering a wrong command or making a one-character typo can cause significant damage to the system. For example, there's a world of difference (or just one dot) between deleting all files in the current directory

rm -rf ./*

and deleting all files on your hard-drive, ignoring read-only flags and avoiding warnings

rm -rf /*(Don't try this at home!)

Therefore, it's considered bad practice to work as a root on a permanent basis. Instead, you use a normal account with limited privileges (e.g. you can't do "rm -rf /*" and other dangerous things) but switch into a superuser mode only as necessary.

You can execute a command as a superuser by prefixing it with "sudo". For example, if you want to delete a file you haven't got permissions to delete and you know the superuser password, you can

sudo rm inaccessibleFile

It will ask you for the password and then the command will be executed with superuser privileges.It can also be used to make sandwiches.

results matching ""

    No results matching ""