The sudo
command allows users to run programs with superuser privileges. It’s used to execute commands requiring administrative access.
Syntax:
Examples:
- Update System Packages
- Edit a System File
- Change Ownership of a File
- Restart a Service
- Run a Script as Superuser
Key Notes:
- Use
sudo
with caution to avoid system changes. - It asks for a password to verify privileges.
- Use
sudo -i
for a persistent superuser session.