2014-06-26 17:12:56 +04:00
|
|
|
# sudo
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
> Execute a command as another user.
|
2014-06-26 17:12:56 +04:00
|
|
|
|
2016-01-16 17:12:05 +03:00
|
|
|
- List of an unreadable directory:
|
2014-06-26 17:12:56 +04:00
|
|
|
|
2014-06-27 20:01:28 +04:00
|
|
|
`sudo {{ls}} {{/usr/local/scrt}}`
|
2014-06-26 17:12:56 +04:00
|
|
|
|
|
|
|
- To edit a file as user www:
|
|
|
|
|
2014-06-27 20:01:28 +04:00
|
|
|
`sudo -u {{www}} {{vi}} {{/var/www/index.html}}`
|
2014-06-26 17:12:56 +04:00
|
|
|
|
|
|
|
- To shutdown the machine:
|
|
|
|
|
2014-06-27 20:01:28 +04:00
|
|
|
`sudo {{shutdown}} -r +10 {{"Cya soon!"}}`
|
2014-06-26 17:12:56 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- To repeat the last command as sudo:
|
2014-06-26 17:12:56 +04:00
|
|
|
|
2014-06-27 20:01:28 +04:00
|
|
|
`sudo {{!!}}`
|