sudo

Linux · Users and permissions · available in the simulator

What it does

Execute a command as administrator (root).

Syntax

sudo [opciones] comando

Options and parameters

  • -i

    Run a login shell as root.

  • -u USER

    Run as another user

  • -k

    Revoke cached credentials.

  • -u

    Run the command as the specified user.

    sudo -u ana ls /home/ana
  • -s

    Run an elevated shell.

  • -l

    List the commands the user is allowed to run.

Usage examples

  • sudo reboot
  • sudo -i
  • sudo -u ana ls
  • sudo apt update
  • sudo -u otro usuario comando
  • sudo -u ana ls /home/ana
Practise sudo

Related commands