Files
tldr/pages.zh/common/su.md

20 lines
388 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# su
> 切换到另一个用户的 shell。
> 更多信息:<https://manned.org/su>。
- 切换到超级用户(需要 root 密码):
`su`
- 切换到指定用户(需要该用户的密码):
`su {{用户名}}`
- 切换到指定用户并模拟完整的登录 shell
`su - {{用户名}}`
- 以另一个用户的身份执行命令:
`su - {{用户名}} -c "{{命令}}"`