Update cheatsheets

This commit is contained in:
ivuorinen
2026-02-08 00:34:23 +00:00
parent c8acbc5872
commit a9c8ccc0e2
34 changed files with 357 additions and 49 deletions

View File

@@ -5,25 +5,25 @@ source: https://github.com/tldr-pages/tldr.git
---
# runuser
> Run commands as a user and group without asking for password (needs root privileges).
> Run commands as a user and group without asking for password.
> More information: <https://manned.org/runuser>.
- Run command as a different user:
`runuser {{user}} {{[-c|--command]}} '{{command}}'`
`sudo runuser {{user}} {{[-c|--command]}} '{{command}}'`
- Run command as a different user and group:
`runuser {{user}} {{[-g|--group]}} {{group}} {{[-c|--command]}} '{{command}}'`
`sudo runuser {{user}} {{[-g|--group]}} {{group}} {{[-c|--command]}} '{{command}}'`
- Start a login shell as a specific user:
`runuser {{user}} {{[-l|--login]}}`
`sudo runuser {{user}} {{[-l|--login]}}`
- Specify a shell for running instead of the default shell (also works for login):
`runuser {{user}} {{[-s|--shell]}} {{/bin/sh}}`
`sudo runuser {{user}} {{[-s|--shell]}} {{/bin/sh}}`
- Preserve the entire environment of root (only if `--login` is not specified):
`runuser {{user}} {{[-p|--preserve-environment]}} {{[-c|--command]}} '{{command}}'`
`sudo runuser {{user}} {{[-p|--preserve-environment]}} {{[-c|--command]}} '{{command}}'`