sudo Meaning: What Does sudo Mean?

sudo allows you to run a Unix command as a different user. Many beginner users are asking for meaning of the sudo command, so here’s my take.

What sudo does

Using /etc/sudoers file to confirm what privileges are available to you, sudo command effectively elevates your access rights, thus allowing you to run commands and access files which would otherwise be not available to you. sudo runs these commands as root by default.

sudo meaning

The meaning of sudo command is:

  • su (switch user)
  • do action (run the specified command under specified user)

Default user in sudo

Unless specified, user is assumed to be root. So when you’re running some sommand using sudo, your specified command is executed as root.

Using one of the most basics examples: id command shows your current username, its user id (UID), group id (GID) and group membership:

[email protected]:~ $ id
uid=1000(greys) gid=1000(greys) groups=1000(greys),989(libvirt)

When we’re running id using sudo, we’re asking sudo to first become user root and to then run the specified command (id) as root:

[email protected]:~ $ sudo id
uid=0(root) gid=0(root) groups=0(root)

As you can see from the output, we get all the root information returned: UID =0, GID=0.

See Also

Keep Learning

Follow me on Facebook, Twitter or Telegram:
I learn with Educative: Educative I'm also a fan of SetApp for macOS: SetApp for macOS
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!
Recent Articles
31 Jan 2023

Homelab: MacBook Pro M2

17 Nov 2022

Video: awk delimiters

25 Oct 2022

macOS Ventura 13.0

Recent Tweets