su — Run a shell with Substitute User


The Indian Patent Office has published a draft patent practice manual.
Read the draft and Email your suggestions to Mr Ramanraj K (ramanraj.k
at gmail dot com), before 15th of August 2005.

One Day One Command

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

Leave a Reply

Your email address will not be published. Required fields are marked *