Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any difference between "sudo su root" and "sudo su - root" ? I know - make the shell a login shell but what difference does it make ? Does the permission varies among them or any change in environment variable happens ?

share|improve this question

1 Answer 1

Login shells run ~/.profile (or the shell-specific equivalent: .login for *csh, .bash_profile, .zshprofile, etc.). Without the -, only a shell-specific interactive config will be run (.cshrc, .bashrc, .zshenv; nothing for ash or derivatives thereof, or for ksh unless $ENV is set properly and sudo propagates it). Also note that sudo can be configured as to how it sets $HOME, which determines whether it's the target account's dotfiles or your own that are used (Debian derivatives use the former, OS X the latter by default) — but using su along with it will override this to the target account in all cases.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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