After I updated to macOS Sierra, Terminal.app and iTerm failed with the same error:

login: /usr/local/bin/bash: No such file or directory

Now I can fix Terminal with this. But then in Terminal:

mkdir: /Users/username/.bash_sessions: Operation not permitted

Also, this does not fix iTerm. So where does this /usr/local/bin/bash come from, why is it missing, and if Sierra deleted it, why isn't the new Terminal updated?

There's a guy with the same problem as mine. So I'm not alone.

2 Answers 2

  • Open System Preferences > Users & Groups.
  • Unlock the padlock at the bottom of the preference pane
  • Hold down the option key and click your account then click the Advanced Options... menu
  • Change your shell to /bin/bash
  • Click the OK button and close the preference pane.
  • Logout then log back in
  • Thanks, now I know where the default shell for a user is.
    – mist
    Nov 3, 2016 at 12:04

/usr/local/bin/bash was from brew install bash. I had /usr/local/bin/bash in /etc/shells. Somehow Sierra update deleted /usr/local/bin/bash and both Terminal and iTerm stopped working. I had to revert back to /bin/bash, reinstall brew and bash 4.4 from brew, and now all is fine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .