su

Table of Contents

su reference

# if <user> is not specified, 'root' is used;
sudo su
sudo su root  # same as above

# Use switch to another user
sudo su yeonghoey

# With '-', su moves to target user's home directory,
# along with his environment variables
sudo su -
sudo su - yeonghoey

# run a command as a user
sudo su -c 'ls /usr' root