mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
38 lines
698 B
Plaintext
38 lines
698 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, linux]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# su
|
|
|
|
> Switch shell to another user.
|
|
> More information: <https://manned.org/su>.
|
|
|
|
- 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]}} "{{command}}"`
|
|
|
|
- Switch to a given user and use a specific shell (e.g., zsh, fish, bash):
|
|
|
|
`su {{[-s|--shell]}} /{{path/to/shell}} {{username}}`
|
|
|
|
- Display help:
|
|
|
|
`su {{[-h|--help]}}`
|
|
|
|
- Display version:
|
|
|
|
`su {{[-V|--version]}}`
|