Key Points#
su
-
The
su
command is for switching to another user. This is useful if you need to run a lot of commands or manage a lot of files as that user.Using
su
is a bit dated and most operations should be done viasudo
, butsu
can still be used form time to time. sudo
-
The
sudo
command can also be used to switch to a user, but it's primarily function is to switch to the user, complete a task, and then "exit" that user session.The benefits of
sudo
is the ability to control what the user can do on a granular level. Thesu
just an all-in command: you simply become the user and can do anything that user can do. Withsudo
, you can control that down to specific commands.