Mac – What are the differences between /usr/bin/login and /usr/bin/bash

macterminal

Terminal.app has a setting to select which shell it uses, and the default setting is "Default login shell (/usr/bin/login)".
What are the differences between /usr/bin/login and /usr/bin/bash?

Best Answer

Griffo is correct. Now in your scenario, the difference boils down to the following:

  1. if you pick /bin/login, then this program will check in the user database what your default shell is and run that shell as a login shell, thereby invoking the rc files that are run only when the shell is run as a login shell (in case of bash those are /etc/profile, ~/.bash_profile, ~/.bash_login and , and ~/.profile.
  2. if you pick /bin/bash, that shell will be executed as a login shell, independently of what shell is set in the user database. This can come in useful when the shell in the user database does not work properly, or you want to be able to use different shells.

As per the comment by Chris Page, the shell is run as a login shell in both cases.

If you have not changed your login shell from the default, which is /bin/bash, and you have not changed the rc files of this shell, then the difference will not be noticeable.