mirror of
https://github.com/tldr-pages/tldr.git
synced 2024-11-14 19:01:35 +03:00
24 lines
464 B
Markdown
24 lines
464 B
Markdown
# sudo
|
|
|
|
> Executes a single command as the superuser or another user.
|
|
|
|
- Run a command as the superuser:
|
|
|
|
`sudo {{less /var/log/syslog}}`
|
|
|
|
- Edit a file as the superuser with your default editor:
|
|
|
|
`sudo -e {{/etc/fstab}}`
|
|
|
|
- Run a command as another user and/or group:
|
|
|
|
`sudo -u {{user}} -g {{group}} {{id -a}}`
|
|
|
|
- Repeat the last command prefixed with "sudo" (only in bash, zsh, etc.):
|
|
|
|
`sudo !!`
|
|
|
|
- Launch the default shell with superuser privileges:
|
|
|
|
`sudo -i`
|