LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-26-2007, 01:53 AM   #1
Echo Kilo
Member
 
Registered: Jul 2004
Distribution: Ubuntu - Debian Based
Posts: 242

Rep: Reputation: 30
How do I change the color of directories?


How do I change the color that directories are displayed?

I'm using a black shell and the blue is hard to see.

I'm using Ubuntu.
 
Old 12-26-2007, 02:08 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
They are controlled by the $LS_COLORS environment variable, specifically the di entry therein. The dircolors command can provide an easy way to modify this env variable. Have a look at the dircolors and dir_colors man pages (the first one with no underscore describes the command and the second with the underscore describes the config file for it).
 
Old 12-26-2007, 02:54 AM   #3
Echo Kilo
Member
 
Registered: Jul 2004
Distribution: Ubuntu - Debian Based
Posts: 242

Original Poster
Rep: Reputation: 30
Thanks, I read thru those and have a slightly better understanding.

Using dircolors, I get:

LS_COLORS='no=00:fi=00:di=01;34 <snip>

and I'm guessing the di=01;34 is controlling the directory color. However, I'm not clear on how to use the dircolor command.
 
Old 12-26-2007, 03:05 AM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Run

dircolors -p > ~/.dir_colors

to create a config file with the default settings in your home directory. Then edit this file to change the color scheme to how you want it and run:

eval `dircolors ~/.dir_colors`

You will probably want to put this in your shell startup script (usually .bashrc, assuming it gets sourced from .bash_profile).

Unfortunately, I can't find a site that lists all the different colors so you may need to experiment. I found this site which has some good information.
 
Old 12-26-2007, 03:07 AM   #5
f5il
LQ Newbie
 
Registered: Dec 2007
Posts: 6

Rep: Reputation: 0
cd ~

vi .bashrc

uncomment the Ls Color
 
Old 12-28-2007, 12:40 AM   #6
Echo Kilo
Member
 
Registered: Jul 2004
Distribution: Ubuntu - Debian Based
Posts: 242

Original Poster
Rep: Reputation: 30
Thank you btmiller!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change the color hraposo Linux - General 1 08-20-2007 04:57 AM
How to make the directories and files in color in the terminal leonall Linux - Newbie 1 03-09-2006 09:13 PM
change color vito_huang Linux - General 1 11-13-2004 01:21 PM
ls --color 'color change' ekdya Linux - General 1 10-06-2003 03:47 PM
counsol color change crealkillerI75 Slackware 8 07-27-2002 06:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration