Results 1 to 8 of 8
Enjoy an ad free experience by logging in. Not a member yet? Register.
what's difference bw su and su -root?
i'm logged as user 'lg' and typed
su and prompts for passwd i gave the root passwd and logged into #.
but when i type ifconfig - its say no cmd found...but i can see ifconfig in /sbin/bin
then i login again as using,
su - root
now ifconfig works ...why is it so..what's difference between loggin as
su and su - root?
su doesn't add path of folders that have root access only in $PATH.
su echo $PATH exit su - echo $PATH
thanks...yes..PATH varies for two...thanks...but is that the only difference between su and su - and there is no there difference??
If you use "su", you do not inherit any of the users environmental variables and settings e.g. the path whereas using "su -" spawns a new login shell with all the users variables and settings.
'su -' changes the present working directory too. its like dropping you at root shell.
- Join Date
- Jun 2007
Cool thread , i am new member to this forum and really liked it
Welcome to the LinuxForums.