How to change folder colour in Linux/Unix

How to change folder color in linux

Every folder or file or rpm in Terminal has some unique color. Now we going to change the default terminal folder color in linux.

Change to current working directory to your home directory
#cd
#pwd

 

First check what is the default folder color ls command
#ls


Copy the file DIR_COLORS to your home directory
#cp /etc/DIR_COLORS ~

 

Move the file to a doted file by the below command
#mv DIR_COLORS .dir_colors

 

Edit the file using vi editor
#vi .dir_colors

Change the value 34(Blue) to 33(yellow) in the line 59

cat .dir_colors  | grep  “DIR 01″

 

Change in to new shell using below command and give ls command to see the changes
#bash
#ls

Another Method of changing the default Terminal color

 

Now we are going to change the Default color of RPM package from red to green

The below environment variable will list all file type color details 
#env | grep LS_COLORS

 

Change the value of the above command
#echo $LS_COLORS > color

 

Edit the file,I am going to change RPM red color to green colors
#vi color

 

Once the editing is completed copy the content in to ~/.bashrc file, Make sure that content is enclosed with single quotes.
#cat ~/bashrc

 

Change in to new shell using below command and give ls command to see the changes
#bash
#ls

Like the same you can change any files color in the above manner.