When a user performs an su command, /bin gets added to the users PATH before /usr/bin.

Solution Verified - Updated -


  • When switching to another user with su, the PATH includes /bin by default:

    # echo $PATH
    # su --login user
    $ echo $PATH
  • From the man page, we can read:

       -, -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
                 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


  • Red Hat Enterprise Linux 7
  • su, login

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content