Search code examples
macosterminalstartup

Mac Terminal startup error


When I start terminal up on mac I am getting this error:

-bash: user@computer:$: command not found

What does it mean?

I ran the following in terminal to diagnose the issue:

echo $PS1
\h:\W \u\$

Solution

  • To determine that this is a startup file issue, try changing the shell to something other than bash.

    ZSH is included with macOS. To change the shell to ZSH run:

    chsh -s /bin/zsh

    You will be prompted for your user password, once complete press ⌘N to open a new terminal window, you will see a slightly different prompt.

    If the error does not occur, then there is an issue in one of the bash startup files. Switch back over to bash with chsh -s /bin/bash and double check your ~/.bashrc, ~/.profile, and ~/.bash_profile, as well as /etc/bashrc and /etc/profile.

    If bash remains broken for you, using ZSH over Bash is always an option.