sudo
is a command and it is an executable program.
You can find out more about how to use it using these commands in the terminal (in order of least -> most detailed):
sudo --help
man sudo
info sudo
To understand more about how it works, you can visit the sudo website where you can browse the source code. You can also download the source code:
First edit /etc/apt/sources.list
sudo nano /etc/apt/sources.list
you will see these lines near the beginning:
deb http://gb.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://gb.archive.ubuntu.com/ubuntu/ xenial main restricted
You have to uncomment the deb-src
line (remove the #) so it says:
deb http://gb.archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ xenial main restricted
Save the file and exit. Now run sudo apt update
and then, to dowload the source code package to the current working directory
apt source sudo
Super short summary: sudo is short for 'superuser do' meaning 'execute the following command as the superuser'. Thus, it grants the humble user root privileges for one command and any commands triggered by that command.