⌨️sudo
Also known as sudo Command, Superuser Do, Run as Root
A command that runs one line as the root user. It asks for your password first.
Think of it like
Think of it like asking a grown-up to reach the top shelf for you. You ask, and they check first.
Example
Jack needs to install a program on his server. He types sudo apt install nginx and enters his own password.
Why it matters
You get root power only when you need it. The rest of the time a typo stays small.
Definition
Example code
console
$ whoami
jack
$ sudo whoami
[sudo] password for jack:
rootCommon mistake
Key takeaways
- 1One command. Root power for just that line.
- 2Your password. Not the root password.
- 3Logged. There is a record of each use.