0

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

  • 4
    Did you look at man su? If so, what part of its explanation did you find confusing? – John1024 Jun 3 '18 at 20:39
  • 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 Jun 3 '18 at 20:41
  • 1
    @Jhon1024, I did not think to read the man su file. Maybe I should have. – Anynomous Jun 4 '18 at 21:20
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/

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.