ODOC: su

su — Run a shell with Substitute User


su allows one user to temporarily become another user. It runs a command with the Real & Effective user id, group id and supplemental groups of a given user. If user not given, it will login as root.


$ su — Run a new shell with root user.

$ su user1 — Run a new shell with user1.

$ su -c ls — Run the command with substitute user.

$ su -f user1 — Fast login (skips startup files).

$ su -p user1 — Preserve the environment variables.

$ su -l user1 — Unset all env variables, change Home dir and run shell startup files.

$ su -s /bin/csh — Run csh shell instead of the user’s default shell.

Read: man su
su, linux, odoc, gnu/linux