What's the distincton between:
sudo su -
and
su -i
and where would one be preferred over the other?
-, -l, --login Start the shell as a login shell with an environment similar to a real login:
o clears all the environment variables except TERM and variables specified by --whitelist-environment o initializes the environment variables HOME, SHELL, USER, LOGNAME, and PATH o changes to the target user's home directory o sets argv[0] of the shell to '-' in order to make the shell a login shell
and
su - run a command with substitute user and group ID
excerpts from the man su
page.