Files
cheatsheet-tldr/tldr/su
2025-03-14 00:18:08 +00:00

26 lines
484 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
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}}"`