mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-09-10 16:13:31 +02:00
sudo: general revision of entry
This commit is contained in:
parent
4f83a102da
commit
84713e06ef
1 changed files with 9 additions and 9 deletions
|
@ -1,23 +1,23 @@
|
|||
# sudo
|
||||
|
||||
> Executes a single command as another user.
|
||||
> Executes a single command as the superuser or another user.
|
||||
|
||||
- List the contents of an unreadable directory:
|
||||
- Run a command as the superuser:
|
||||
|
||||
`sudo {{ls}} {{/usr/local/scrt}}`
|
||||
`sudo {{shutdown now}}`
|
||||
|
||||
- Edit a file as the user www:
|
||||
- Edit a file as the superuser with your default editor:
|
||||
|
||||
`sudo -u {{www}} {{vi}} {{/var/www/index.html}}`
|
||||
`sudo -e {{/etc/fstab}}`
|
||||
|
||||
- Shut down the machine:
|
||||
- Run a command as another user and/or group:
|
||||
|
||||
`sudo {{shutdown}} -h +10 {{"Cya soon!"}}`
|
||||
`sudo -u {{user}} -g {{group}} {{id}}`
|
||||
|
||||
- Repeat the last command as sudo:
|
||||
- Repeat the last command prefixed with "sudo" (only in bash, zsh, etc.):
|
||||
|
||||
`sudo !!`
|
||||
|
||||
- Launch the default shell with root privileges:
|
||||
- Launch the default shell with superuser privileges:
|
||||
|
||||
`sudo -i`
|
||||
|
|
Loading…
Add table
Reference in a new issue