Linux and Unix su command

Quick links

About su
Syntax
Examples
Related commands
Linux and Unix main page

About su

Become super user or another user.

Syntax

su [ - ] [ username [ arg ] ]

-Pass the environment along unchanged, as if the user actually logged in as the specified user.
usernameThe name of another username that you wish to log in as.
argAdditional arguments that need to be passed through the su command.

Examples

su - hope

Login as the user hope as if the user hope actually logged in (process all login scripts etc...)

Related commands

csh
env
ksh
login
sh
sudo