Suse & OpenSuse : Tips, Tricks, Tutorials, How Tos and Troubleshooting

What’s the difference between “su” and “su –”?

opensuse terminal

We get asked this question quite often and maybe it is good to give a simple explanation.  “su” by itself means that you would like to assume the super user identity.  You can also assume the identity of another user using “su <userid>”.

Then, many people actually ask why do we usually type “su –” instead of just “su”?  The main difference is that the one with the “-“ will run the to-be-assumed userid’s startup scripts which will basically mean that you will have the environment settings (such as $PATH) as though you are logged in as the new userid.  Without the “-“, you will have the environment settings of the current userid (probably your userid).

RSS feed | Trackback URI

Comments »

No comments yet.

Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.