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

20 lines
336 B
Markdown
Raw Normal View History

2014-06-26 18:42:56 +05:30
# sudo
2017-09-15 10:59:13 +01:00
> Executes a single command as another user.
2014-06-26 18:42:56 +05:30
2017-09-15 10:59:13 +01:00
- List the contents of an unreadable directory:
2014-06-26 18:42:56 +05:30
2014-06-27 21:31:28 +05:30
`sudo {{ls}} {{/usr/local/scrt}}`
2014-06-26 18:42:56 +05:30
2017-09-15 10:59:13 +01:00
- Edit a file as the user www:
2014-06-26 18:42:56 +05:30
2014-06-27 21:31:28 +05:30
`sudo -u {{www}} {{vi}} {{/var/www/index.html}}`
2014-06-26 18:42:56 +05:30
2017-09-15 10:59:13 +01:00
- Shut down the machine:
2014-06-26 18:42:56 +05:30
`sudo {{shutdown}} -h +10 {{"Cya soon!"}}`
2014-06-26 18:42:56 +05:30
2017-09-15 10:59:13 +01:00
- Repeat the last command as sudo:
2014-06-26 18:42:56 +05:30
2017-09-20 22:45:15 +01:00
`sudo !!`