Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When I start my terminal I get "login: /usr/local/bin/bash: No such file or directory [Process completed]" and i cant type anything in my terminal

These are the series of commands I entered that cause the problem.

brew install bash
echo '/usr/local/bin/bash' | sudo tee -a /etc/shells
chsh -s /usr/local/bin/bash

Now when I start my terminal, I get this.

Last login: Sun Apr  7 14:40:48 on ttys008
login: /usr/local/bin/bash: No such file or directory

[Process completed]

I can't write to the terminal unless I got to Shell->New Command and then type in "\bin\bash"

Anyone know a solution to this?

like image 718
Yvan Niyonzima Avatar asked Apr 07 '19 18:04

Yvan Niyonzima


People also ask

How do I make Bash my default shell Mac?

From System PreferencesHold the Ctrl key, click your user account's name in the left pane, and select “Advanced Options.” Click the “Login Shell” dropdown box and select “/bin/bash” to use Bash as your default shell or “/bin/zsh” to use Zsh as your default shell. Click “OK” to save your changes.

What shell does a Mac use?

Mac OS X Shells Mac OS X comes with the Bourne Again SHell (bash) as the default user shell and also includes the TENEX C shell (tcsh), the Korn shell (ksh), and the Z shell (zsh). bash, ksh, and zsh are compatible with sh, the original Bourne shell.


Video Answer


2 Answers

  1. Go to "System Preferences" > "Users & Groups"
  2. Click the "Lock" icon and authenticate
  3. Right-click the your user icon and select "Advanced Options"
  4. Change the value for "Login shell" to /bin/bash
like image 114
Amol Ray Avatar answered Sep 18 '22 13:09

Amol Ray


The "System Preferences" option did not work for me cause there wasn't any "Advanced Options" within "Users & Groups" (For reference: I am running Monterey 12.2). The following worked for me:

  • Open a new terminal. For now it will show /usr/local/bin/bash: No such file or directory.
  • Press Command + , which should open the terminal preferences. Terminal Preferences
  • Select the Command (complete path) option for the Shells open with: choice.

  • Enter the value as /bin/bash or /bin/zsh based on your preference.

  • Close and reopen the terminal. You should now have a working terminal.

like image 33
ThePretendProgrammer Avatar answered Sep 18 '22 13:09

ThePretendProgrammer