Learn Difference Between “su” and “su -” Commands in Linux

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

10 Responses

  1. Jonix says:

    From the manpage of ‘su‘ (on opensuse).

    #####8<#####
    NAME
    su – run a command with substitute user and group ID

    SYNOPSIS
    su [options] [-] [user [argument…]]

    DESCRIPTION
    su allows to run commands with a substitute user and group ID.

    When called without arguments, su defaults to running an interactive shell as root.

    For backward compatibility, su defaults to not change the current directory and to only set the environment variables HOME and SHELL (plus USER and LOGNAME if the target user is not root). It is recommended to always use the
    –login option (instead of its shortcut -) to avoid side effects caused by mixing environments.
    #####8<#####

    So, the su means 'switch user', with the default user being the "top" administrative user, as Aaron explains

    • Aaron Kili says:

      @Jonix

      We do not have to copy and paste the definition from man pages in our articles, we simply explain in terms users can easily understand and relate with. Of course, you can always find more information in man pages.

      And different distros offer different command/program descriptions. For example on Ubuntu or Linux Mint, the man page says:
      “NAME su – change user ID or become superuser”

      Thanks for sharing your thoughts with us.

  2. Marshall Neill says:

    su without a username and you become the root user not super user. There is no such thing as super user, just root user. That super user crap started years ago and is still perpetuated. sheesh

    • Aaron Kili says:

      @Marshall

      I guess we have fallen victims of using superuser to mean root user. However, the two words “root” and “superuser” are used interchangeably in relation to Unix/Linux operating systems today. According to Wikipedia, “superuser is a special user account used for system administration. Depending on the operating system (OS), the actual name of this account might be root, administrator, admin or supervisor.”

      Thanks for sharing your concern with us.

      • dragonmouth says:

        During the install, some distros ask if the first user created is to be the administrator. If you say YES, that user becomes the superuser but he DOES NOT become the root.

        • Aaron Kili says:

          @dragonmouth

          Yes, this is correct. But in the article, we are referring to root as the superuser(vice versa), who has absolute permission to perform any kind of task on a Linux system, without using sudo command.

          Thanks for pointing this out.

  3. Jonix says:

    One interesting thing that can be done with sudo is starting a “longtime” shell by issuing ‘sudo bash‘ ; instead of issuing root-claimimg commands one at a time (do remember to logout of this subshell when finished, to avoid stupid things done with the power-of-root)

  4. Phil Wiggins says:

    And what about”sudo su” and “sudo su -“

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.