su - switch to another user
$ su [-] [user]
$ su [-] [user] [-c command]
su
: Switch to another user.
When called with no user-specified, su
defaults to switch to the root user. Need to enter the password if the user switch to has one.
-
, -l
, --login
: Start the shell as it was a real login-c
, --command
: Execute a command using /bin/sh
instead of starting an interactive shelluser
: User to switch to (defaults to the user with UID 0)Switch to root user
$ su
Switch to another user
$ su nona