Untitled Document
su Command

su - Change the current user ID to that of the superuser, or another user.The su command, which is short for substitute user or switch user, is used to become another user during a login session.

Example 1 - Syntax of su command

The syntax of su command is as follows

   su [options] [username]    

Example 2 Basic Example

If no username is specified, su defaults to becoming the superuser (root). On successful login it will give you # prompt , the same prompt used by superuser

   # _     

Example 3 - Login with another username

Below command will login with user mangadaku .Switch the current user ID to that of user mangadaku, and set the environment to mangadaku's login environment.

   su mangadaku
   password: **********
   $ _    
Untitled Document