Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Sudo

Sudo used on pacman
Release Status Maintained
Last Release 1.9.16p2, 2024-11-25
Language(s) C
Developer(s) sudo project
Website www.sudo.ws/
Sudo's logo of a sandwich
Output from sudo when Defaults insults is added

The command line tool sudo is used to run commands as another user (most likely root).[1] Its name is shorthand for "su 'do'"[2], however as su stands for "substitute user"[3] this would stand for "substitute user, do". System administrators may configure sudo by editing the /etc/sudoers file[1] to specify which users or groups can execute specific commands.

Usage

Common Sudo Commands
Command Description
sudo <command> Run the given command as superuser
sudo -E <command> Run the given command as superuser while keeping the current user's env vars
sudo -s Opens a shell with superuser permissions

note: every mentioned command is also compatible with the -u <user> argument, which will run the command as the given user instead of superuser[1]

Trivia

  • Sudo's logo is a sandwich in reference to xkcd 149[4]
  • If you add the line Defaults insults to the Defaults section of /etc/sudoers, you will be insulted whenever you type the wrong password.[5]

References

  1. 1.0 1.1 1.2 sudo(8), Linux Manpages
  2. sudo.ws, Sudo Developers
  3. su(1), Linux Manpages
  4. sudo.ws/about/logo, Sudo Developers
  5. When sudo insults you!!, GeeksforGeeks, September 13, 2023 (February 12, 2025)