'su' vs 'su -' - What's the difference?
What's the difference between these two:
Code:
su Code:
su - |
see the man page:
-, -l, --login make the shell a login shell with - the new shell will be a login shell therefore a new environment will be set. without - the new shell will inherit the environment from the parent. |
-l Simulate a full login. The environment is discarded except for HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified as above.
USER is set to the target login. PATH is set to ``/bin:/usr/bin''. TERM is imported from your current environment. The invoked shell is the target login's, and su will change directory to the target login's home directory. - (no letter) The same as -l. |
All times are GMT -5. The time now is 12:57 PM. |