views:

1715

answers:

4

I'm new to Mac having just got one after working with Ubuntu Linux for some time. Among the many things I'm trying to figure out is absence of colors in my the terminal window - like the ones that are shown (on linux) when you run 'ls -la' or 'git status'... I just can't figure out how to activate them in the actual shell.

+1  A: 

Check what $TERM gives: mine is xterm-color and ls -alG then does colorised output.

William Rose
+5  A: 

Hi,

If you want to have your ls colorized you have to edit your ~/.bash_profile file and add the following line (if not already written) :

source .bashrc

Then you edit or create ~/.bashrc file and write an alias to the ls command :

alias ls="ls -G"

Now you have to type source .bashrc in a terminal if already launched, or simply open a new terminal.

If you want more options in your ls juste read the manual ( man ls ). Options are not exactly the same as in a GNU/Linux system.

Zapan
A somewhat better option is to replace the 'alias' definition with 'export CLICOLOR=" "'. This has the advantage of usually continuing to work even if you switch shells during a terminal session (as long as environment variables are inherited - aliases aren't).
Ned Deily
+1  A: 

Thanks for the help guys - this thread helped me solve the color issue (Bill's solution).

sa125
You should probably add this as an addendum to your question, and give credit (in the form of an accepted answer, and maybe an upvote too) to the person who helped you most.
Jonathan Leffler
A: 

When I worked on MACOSX in the lab I was able to get the terminal colors from using Terminal (rather than X11) and then editing the profile (from the MAC menu). The interface is a bit odd on the colors, but you have to set the modified theme as default.

Further settings worked by editing .bashrc

ccook