1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-02 15:38:28 +01:00
tldr/pages/common/sudo.md

21 lines
325 B
Markdown
Raw Normal View History

2014-06-26 15:12:56 +02:00
# sudo
> execute a command as another user
- Listing of an unreadable directory:
2014-06-27 18:01:28 +02:00
`sudo {{ls}} {{/usr/local/scrt}}`
2014-06-26 15:12:56 +02:00
- To edit a file as user www:
2014-06-27 18:01:28 +02:00
`sudo -u {{www}} {{vi}} {{/var/www/index.html}}`
2014-06-26 15:12:56 +02:00
- To shutdown the machine:
2014-06-27 18:01:28 +02:00
`sudo {{shutdown}} -r +10 {{"Cya soon!"}}`
2014-06-26 15:12:56 +02:00
- To repeat the last command as sudo
2014-06-27 18:01:28 +02:00
`sudo {{!!}}`