Linux – What’s the difference between “su” and “su -“


In a UNIX machine, what is the difference between su and su -?
Is there even a difference?
I know that su - is the standard.

Best Answer

Well the su - "Username" or su -1 "username" or su --login "username" (all the same) will give you a login screen, and change paths, home directory, etc..

The su "username" command only chances user, and not home directories (this does not apply to "su no username" because you login has Root / SuperUser, and you will given the root's default environment, including path to executable file changes. You will also land into the root's home directory.) so to answer your question to make sure they are in the right place with the right user?

Ref link :

Related Question