Sudo Command

What is the Sudo Command?

The sudo command allows a permitted user to execute a command as the superuser or another user.

How Does It Work?

When you run a command with sudo, you are asked to provide your password to confirm your identity and gain the necessary privileges.

Syntax: sudo command

Common Uses of Sudo

The sudo command is commonly used for tasks that require elevated privileges, such as installing software or modifying system settings.

Examples

To update system packages: $ sudo apt update
To change the password for a user "john" (as a superuser): $ sudo passwd john

Visual Guide

Below is a visual example of using the sudo command:

Sudo Command Example