The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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-03-2007 03:55 AM
how to synchronize different dirs reldb Shell Programming and Scripting 1 12-09-2006 08:08 PM
Making dirs in a partition smo59 UNIX for Dummies Questions & Answers 2 06-22-2005 01:58 PM
Combining Two Dirs Phobos UNIX for Dummies Questions & Answers 2 01-26-2005 09:13 PM
I need to ls all files in 4-6 deep dirs gforty UNIX for Dummies Questions & Answers 4 09-18-2003 06:18 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-13-2001
tk876 tk876 is offline
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 12:41 PM..
  #2 (permalink)  
Old 07-13-2001
Andy Hibbins Andy Hibbins is offline
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 (permalink)  
Old 07-13-2001
tk876 tk876 is offline
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 (permalink)  
Old 07-13-2001
Andy Hibbins Andy Hibbins is offline
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 (permalink)  
Old 07-17-2001
kapilv kapilv is offline
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0