PDA

View Full Version : What is the difference between su and su -



royeo
20th September 2006, 06:43 PM
I'm often in a terminal and need to be in super user mode. I used to just enter "su" but now I use "su -". I figure I can't lose by having too much but I just don't know. Are there times when you shouldn't use "su -"?

Thanks,

royeo

pparks1
20th September 2006, 06:45 PM
su with the dash (su -) also loads root's path. That way, you can find things in /sbin and such. Without the dash (-), you simply become root and retain the user path...so things like ifconfig won't work without specifying /sbin/ifconfig.

I would just get used to using su - and simply forget that su exists.