What’s the difference between “su” and “su -“
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/
Anonymous
I'm a long-time Stack Overflow user, but I'm now mainly participating in SF&F Stack Exchange. I visit Stack Exchange every day and help out when I can. I edit, review and post often an am the creator of Anynobot, a chat bot and made TeamMod. If you want to talk to me, ping me in whatever room I'm in. Feel free to join me on Discord!
Updated on September 18, 2022Comments
-
Anonymous over 1 year
In a UNIX machine, what is the difference between
su
andsu -
? Is there even a difference? I know thatsu -
is the standard.-
John1024 almost 6 yearsDid you look at
man su
? If so, what part of its explanation did you find confusing? -
Jason Bassford almost 6 yearsI also would not say that
su -
is the standard. I'd assume that most people who usesu
do so simply for the root-level permission . . . -
Anonymous almost 6 years@Jhon1024, I did not think to read the
man su
file. Maybe I should have. -
jdhao over 4 yearsPossible duplicate: unix.stackexchange.com/questions/7013/…
-