MacOS – How to change bash version with homebrew

bashmacos

I have used homebrew to install the newest version of bash on my local system. I have added a symbolic link from: /usr/local/bin/bash to /usr/local/Cellar/bash/4.2.20/bin/bash and added the line: /usr/local/bin/bash to /etc/shells

When I load my terminal I am still getting the older version of bash, also when i execute the command: /etc/local/Cellar/bash/4.2.20/bin/bash my prompt changes to bash-4.2$ but when i do bash --version it still says I am in version 3.2. Does anyone know what step I am missing?

Best Answer

You'll need to change your account's login shell from System Preferences, Users & Groups. You need to access the Advanced Options by right-clicking on your username and changing your shell to /usr/local/bin/bash. Once you've done that, restart Terminal.app (to make sure no old sessions with the wrong shell are left hanging around) and you should be set.

Change login shell

You can do the same using dscl:

dscl . -change /Users/<username> UserShell /usr/local/bin/bash