Adding Color to ls ?

I just got started back to the terminal and I'd like to use color in the ls,
I used the command export CLICOLOR=YES and it work the first time only in one color blue for directories and black for .files, OK, Now I want to put the
CLICOLOR in my .bash_profile, What line do I use?

Posted on Sep 16, 2005 6:22 AM

Reply
4 replies

Sep 16, 2005 12:48 PM in response to FVS

I may be wrong, (I am somewhat new to this), but I'd say your .bash_profile is a fine place for changing settings like that. Again, I could be wrong, but I submit that you should just put it, ( export CLICOLOR=YES), at the end of your ~/.bash_profile.

On second thought, depending on what types of terminals you remotely connect to this machine/account with, you may want to have this change for all bash sessions. Trying not to overcomplicate things too much, you can put something to the effect of:

# test for a .bashrc file and source it if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi


into your ~/.bash_profile instead, and put the export CLICOLOR=YES line into ~/.bashrc.

Worked for me. Write back with any questions or problems.
Cheers, Joel

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Adding Color to ls ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.