Internal Links
Main
Mac
Linux
Previous Work
Blog
Contact
External Links
By default the ls command displays the results color coded. For example

Notice that directories are colored blue and some files are colored green. This can be quite annoying depending on the color scheme of the terminal app you are using. There are some instances where these color codings are very useful. You can tell which items are directories without doing a long listing, or whither a symbolic link points to something that isn't there. Fortunately, like almost everything in Linux you can tweak the color output of the ls command through a simple flat text file. You can use the dircolors command but RedHat has gone through the trouble already of configuring a file that we can use. The first thing to do is copy the DIR_COLORS template file out of the /etc directory into our home.
cp /etc/DIR_COLORS ~/.dir_colors
There is a script that runs called /etc/profile.d/colorls.sh that will first look in /etc for the DIR_COLORS file and then look for .dir_colors inside your home folder which will override the the one in /etc. Edit the .dir_colors file to your liking. The file is well commented so customizing it should be straight forward.
There are two ways to temporarily remove the colors from ls. You can use the ls –color=none option or get rid of the alias that is created by default to use colors when you login.
unalias ls