1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/sudo.md
Starbeamrainbowlabs e8fe8aaa9e Update sudo.md
2017-10-02 09:50:47 +05:30

336 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 !!