mirror of https://github.com/CrimsonTome/tldr.git
20 lines
330 B
Markdown
20 lines
330 B
Markdown
# su
|
|
|
|
> Switch shell to another user.
|
|
|
|
- Switch to superuser (requires the root password):
|
|
|
|
`su`
|
|
|
|
- Switch to a given user (requires the user's password):
|
|
|
|
`su {{username}}`
|
|
|
|
- Switch to a given user and simulate a full login shell:
|
|
|
|
`su - {{username}}`
|
|
|
|
- Execute a command as another user:
|
|
|
|
`su - {{username}} -c "{{command}}"`
|