The su command is used to switch you to another user account and therefore give you all of the rights and privileges of the user account you are switching to. This is especially useful for switching from a normal user account to the Superuser account to perform some system administration tasks.

Of course, in order to use the su command to switch to another account you will need the password of the account you are switching to.

Example:

The following example will switch you to the Ted user account (assuming it exists on your system):

$ su - Ted
Password:
$ pwd
/home/Ted
$

Note: The - option will switch you to the user's home directory (as well as run all of the users login scripts). Without it you will remain in the directory you are in when you switch.

To switch back to your previous user account session, use the exit command:

$ exit