Hello,
When switching to the root user, what is the difference between using the "su root" command and the "su - root" command? Either way seems to work fine for me. I was just curious which method is best practice.
Thank you.
su root vs. su - root
Moderator: NorbertKrupa
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: su root vs. su - root
Hi,
I don't think its a matter of "Best Practice". It depends on what you want to happen!
Both "su - root" and "su root" will start a new shell for you. The difference is that "su - root" will execute root's profile, while "su root" does not...
I hope this helps!
I don't think its a matter of "Best Practice". It depends on what you want to happen!
Both "su - root" and "su root" will start a new shell for you. The difference is that "su - root" will execute root's profile, while "su root" does not...
I hope this helps!
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Re: su root vs. su - root
Thank you, Jim! I will start using su with the hyphen.