linux su and su - command of the essential difference

The essential difference

su  just switch the root, but Shell is still common user environment of Shell;

su - to switch the user environment and Shell together to root identity; the only switch the environment Shell will not appear PATH environment variable error;

 

Difference phenomenon

1, the working directory

su  working directory does not change, the average user is still working directory;

su - switch to the working directory of the root ;

 

2, Environment Variables

su  environment has not changed, still the common user environment l;

su - to root environment ;

 

Icon:

 

Guess you like

Origin www.cnblogs.com/fixdq/p/11890676.html