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}}"
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.