The terminal does not start properly. Bash command not found

I have problems with my terminal after trying to install Homebrew on my Mac. When I start the terminal, I get:

-bash: touch: command not found

When I do echo $PATH, I get:

/usr/local/bin:??

I tried several sentences, for example

export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin

and then it works, but when I restart my terminal, it starts with everything.

+4
source share
1 answer

According to the bash man page , .bash_profile is executed for login systems, and .bashrc is executed for non-login interactive shells.

Mac OS X launches the default login shell for each new terminal window by calling .bash_profile instead of .bashrc.

PATH .bash_profile

vim ~/.bash_profile

PATH ( )

export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
+5

All Articles