Ubuntu – What is the sudo -i command

sudo

What does the sudo -i command do and in which situations would it be used. read it using the man sudo command but i'm looking for a more diluted discription to help me understand better.

Best Answer

  • sudo lets you run commands in your own user account with root privileges. su lets you switch user so that you're actually logged in as root.

    sudo -s runs a shell with root privileges. sudo -i does this as well, but also acquires the root user's environment.

    This means that login-specific resource files such as .profile, .bashrc or .login will be read and executed by the shell.