The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
monitoring dirs da-seot Shell Programming and Scripting 1 09-02-2007 11:55 PM
how to synchronize different dirs reldb Shell Programming and Scripting 1 12-09-2006 05:08 PM
Making dirs in a partition smo59 UNIX for Dummies Questions & Answers 2 06-22-2005 09:58 AM
Combining Two Dirs Phobos UNIX for Dummies Questions & Answers 2 01-26-2005 06:13 PM
I need to ls all files in 4-6 deep dirs gforty UNIX for Dummies Questions & Answers 4 09-18-2003 02:18 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-13-2001
Registered User
 

Join Date: Jul 2001
Posts: 2
Question dirs & colors

hi @all

question from an absolute beginner:

I want directory listings to be displayed with different colors...

what do I have to do and where can I find the settings?

thx

Last edited by tk876; 07-13-2001 at 08:41 AM.
Forum Sponsor
  #2  
Old 07-13-2001
Registered User
 

Join Date: Jun 2001
Location: Leicestershire, UK
Posts: 92
Hi,



if you're using the bash shell you could create an alias for the "ls" command using the color option to differentiate file types.



i.e. in your ~/.bash_profile file add



alias ls='ls --color="always"'

On my system the colours for different file types are a follows:



executable files green

archive files (.gz,.zip,etc,) red

ascii files white

jpgs,bmp files magenta

symbolic links cyan

directories blue



I'm not sure if you can change the colours for different file types.





Andy Hibbins
  #3  
Old 07-13-2001
Registered User
 

Join Date: Jul 2001
Posts: 2
I've made the changes and it works fine...

but how can I define the colors for dirs, ascii files etc.

thanks again
thomas
  #4  
Old 07-13-2001
Registered User
 

Join Date: Jun 2001
Location: Leicestershire, UK
Posts: 92
To alter the colours for different file type you need to edit the dircolors config file.



On my system this is installed under /etc/DIR_COLORS



you may also need to add the following to /etc/profile or ~/.bash_profile file



eval `dircolors -sh /etc/DIR_COLORS`


I don't need to add this to my /etc/profile ~/.bash_profile because it get's executed vi a script called color_ls.sh in the /etc/profile.d directory.




Andy Hibbins

  #5  
Old 07-16-2001
Registered User
 

Join Date: Nov 2000
Location: India
Posts: 83
Hi

One more thing you can do is copy the /etc/DIR_COLORS file to your home directory as .dir_colors file and then edit it. The /etc/DIR_COLORS file have all the necessary information as well as the color codes to display your files or directories in diferrent color codes.
Hope This works
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0