tldr/pages/common/sudo.md

20 lines
323 B
Markdown
Raw Normal View History

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