Command line prompt doesn't work on MacOS

  |   Source

If you are working in a terminal application on a Mac and it just doesn't seem to work correctly, try this:

Open a terminal window and type this in to see if you have a .bashrc file:

ls -la .bash*

If you see a .bash_profile file but not a .bashrc file, create a .bashrc file:

vi .bashrc

Then go in to insert mode (hit the i key) and type or copy in the text below:

source ~/.bash_profile

Then save and close the file. (hit the esc key and then type :wq)

If you see both a .bashrc and a .bash_profile, look at the .bashrc file:

vi .bashrc

It should contain the following code:

source ~/.bash_profile

If it doesn't, add it to the bottom of the file.

Close all the Terminal windows and then reopen one and try the terminal application again.

For some reason, a Mac may only have a .bash_profile file and some GNU terminal applications (like Screen) look to the .bashrc file for configuration information, but not the .bash_profile file.

Comments powered by Disqus