The
su utility allows you to become root or any other user (you will be required to enter the root or other user password).
su, by itself, is extremely limited in terms of PATH and other environment settings:
Code:
fubar-trona-/home/trona: su
Password:
fubar-root-/home/trona: print ${PATH}
/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
It's for quick and dirty "super user" work such as changing permissions or executing commands that otherwise you as a normal user would not be able to do.
[I]su -/I], however, is "as if you logged in as the user on the console." Note the difference:
Code:
fubar-trona-/home/trona: su -
Password:
As of next week, passwords will be entered in Morse code.
fubar-root-/root: print ${PATH}
.:/root/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/GMT/bin:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/usr/lib64/kde4/libexec:/usr/lib64/qt/bin:/usr/share/texmf/bin
The dash gives you the full environment settings of the user, be it root or any other user.
sudo is a sort of one-shot utility; you run something once and that's that (pretty much). Either
su or
su - will stay in effect until you exit. Doesn't make much sense to use them in series.
Hope this helps some.