Linux

sudo

CautionRun as superuser

sudo <command>

Runs one command as root. -i opens a root shell; -u runs as another user. Policy lives in sudoers.

Examples

  • sudo systemctl restart nginxRestart a service as root
  • sudo -iOpen a root shell

Syntax

sudo [-i] [-u user] <command>

Before you run it

Mistakes affect the whole system.

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store