oreilly.comSafari Books Online.Conferences.


Linux in a Nutshell

This directory of Linux commands is from Linux in a Nutshell, 5th Edition.

Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.

Buy it now, or read it online on Safari Bookshelf.


sudo [options] [command]

If you are allowed, execute command as the superuser. Authorized users of sudo and the commands they are permitted to execute are listed in the sudo configuration file, /etc/sudoers. If an unauthorized user attempts to run a command, sudo will inform an administrator via email. By default, it will send the message to the root account. Users attempting to run commands are prompted for their password. Once authenticated, sudo sets a timestamp for the user. For five minutes from the timestamp, the user may execute further commands without being prompted for her password. This grace period may be overriden by settings in the /etc/sudoers file. Also see /etc/sudoers for configuration examples.



Execute command in the background.


Print help message, then exit.


Revoke user's sudo permissions. Similar to -K, but changes user's timestamp to the Epoch instead of revoking it.


List all allowed and forbidden commands for the user on the current host, then exit.

-p promptstring

Use the specified promptstring to prompt for a password. The string may contain the following escape codes, which will be replaced with the current user's login name and local hostname.


Local hostname without the domain name.


Local hostname with the domain name.


Current user's login name


Login name of the user the command will run under. The default is root.


A single percent (%) character.


Run the shell specified in the SHELL environment variable, or the default shell specified in /etc/passwd. If a command is given, it should be a shell script and not a binary file.

-u user

Run command as the specified user instead of the root user. This may also be specified as a user ID number using #uid.


Update timestamp for user. Prompt for password if necessary.


Set the HOME environment variable to the home directory of the target user.


Remove user's timestamp.


List parameters that may be set as defaults for a user in the /etc/sudoers file.


Preserve initial user's group membership.


Read password from standard input instead of from the console.


Print version number, then exit. When run by the root user, print sudo's defaults and the local network address as well.


Stop reading command-line arguments.

Linux Resources
  • Linux Online
  • The Linux FAQ
  • Linux Kernel Archives
  • Kernel Traffic

  • Sponsored by: