O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Users and Superusers

Linux is a multiuser operating system: multiple people can use a single Linux computer at the same time. On a given computer, each user is identified by a unique username, like “smith” or “funkyguy,” and owns a (reasonably) private part of the system for doing work. There is also a special user named root—the superuser—who has the privileges to do anything at all on the system. Ordinary users are restricted: though they can run most programs, in general they can modify only the files they own. The superuser, on the other hand, can create, modify, or delete any file and run any program.

To become the superuser, you needn’t log out and log back in; just run the su command (see Becoming the Superuser) and provide the superuser password:

$ su -l
Password: *******
#

The superuser prompt (#) indicates that you’re ready to run superuser commands. Alternatively, run the sudo command (if your system is configured to use it), which executes a single command as the superuser, then returns control to the original user:

$ sudo ls /private/secrets           View a protected directory
Password: *******
secretfile1    secretfile2           It worked!
$

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required