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

0

1

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

Anonymous

Posted 2018-06-03T20:33:42.813

Reputation: 107

4Did you look at man su? If so, what part of its explanation did you find confusing? – John1024 – 2018-06-03T20:39:26.390

I also would not say that su - is the standard. I'd assume that most people who use su do so simply for the root-level permission . . . – Jason Bassford Supports Monica – 2018-06-03T20:41:47.247

1@Jhon1024, I did not think to read the man su file. Maybe I should have. – Anonymous – 2018-06-04T21:20:51.277

Possible duplicate: https://unix.stackexchange.com/questions/7013/why-do-we-use-su-and-not-just-su

– jdhao – 2019-09-29T10:04:00.867

Answers

0

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 : https://www.tecmint.com/difference-between-su-and-su-commands-in-linux/

Ryan

Posted 2018-06-03T20:33:42.813

Reputation: 51