The difference between the linux command su and su- The maximum essential difference between the

  
su command and the su-command is: su just switches the root identity, but the shell environment is still the shell of the normal user; and su - even the user and the shell environment switch to root Identity. The PATH environment variable error does not occur only when the shell environment is switched. After su switches to the root user, pwd, and finds that the working directory is still the working directory of the ordinary user; after switching with the su - command, the working directory becomes the root working directory. Use the echo $PATH command to see how su and su - future environment variables are different. By analogy, to switch from the current user to another user, you should use the su - command.
Copyright © Windows knowledge All Rights Reserved