1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-10-31 06:18:17 +01:00
tldr/pages/common/sudo.md
2017-11-29 08:57:56 +05:30

397 B

sudo

Executes a single command as another user.

  • List the contents of an unreadable directory:

sudo {{ls}} {{/usr/local/scrt}}

  • Edit a file as the user www:

sudo -u {{www}} {{vi}} {{/var/www/index.html}}

  • Shut down the machine:

sudo {{shutdown}} -h +10 {{"Cya soon!"}}

  • Repeat the last command as sudo:

sudo !!

  • Launch the default shell with root privileges:

sudo -i