Color terminal under Mac OS X

One thing that annoys me since I started using Mac OS X is that there is no color in the terminal. So I added the following lines to my .bashrc file:

export TERM="xterm-color"
alias ls="ls -G"
PS1="\\[\\033[01;32m\\]\\[email protected]\\h\\[\\033[01;34m\\] \\w \\$\\[\\033[00m\\] "

For some reason, I also had to add the following line at the end of the global bashrc file (/etc/bashrc) so that my user bashrc file is read:

. ~/.bashrc

See also my post I have had it with Firefox under MacOS.

Published by

Daniel Lemire

A computer science professor at the University of Quebec (TELUQ).

4 thoughts on “Color terminal under Mac OS X”

  1. I’m pretty sure that in the normal course of events, bash reads your .bash_profile on login. Most .bash_profile files then source the .bashrc

    Ex .bash_profile:

    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see