Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

custom coloring for ls -l

4 views
Skip to first unread message

Gary Wessle

unread,
May 12, 2006, 2:19:40 PM5/12/06
to
dear hackers

I am looking at a console which is black background, ls -l some times
puts different colors depending on some conf_file, well, is there a
way to see all those colors at once shut and change any as I like.

I find it very difficult to read directory names in dark blue with
black background, I would like to keep the black background though.
googling ls -l "custom coloring" -> nothing

thanks

Stachu 'Dozzie' K.

unread,
May 12, 2006, 3:03:06 PM5/12/06
to
On 12.05.2006, Gary Wessle <phd...@yahoo.com> wrote:
> dear hackers
>
> I am looking at a console which is black background, ls -l some times
> puts different colors depending on some conf_file, well, is there a
> way to see all those colors at once shut and change any as I like.
>
> I find it very difficult to read directory names in dark blue with
> black background, I would like to keep the black background though.

What system? On my Solaris ls don't print colors, just text.

> googling ls -l "custom coloring" -> nothing

You should have read man page instead of googling.

--
Feel free to correct my English
Stanislaw Klekot

Sashi

unread,
May 12, 2006, 4:24:26 PM5/12/06
to

I suspect that you're using Linux and using a client like Putty. I had
the same problem.
If you're using Linux and see dark blue colors for directory entries,
do the following:
Copy the file /etc/DIR_COLORS to your home directory (or anywhere else
you please) as .dircolors (or any other name).
Now open this .dircolors directory and change the line
DIR 01;34 # directory
to
DIR 01;33 # directory
and save your file.
Your default shell will likely be bash in Linux. Add this line in your
.bash_profile:
eval $(dircolors $HOME/.dircolors)
and either source your .bash_profile or logout and login.

This is the general approach. If this hasn't fixed it, you probably got
the idea and should be able to tweak it.
Sashi

Stachu 'Dozzie' K.

unread,
May 12, 2006, 4:32:37 PM5/12/06
to
On 12.05.2006, Sashi <smal...@gmail.com> wrote:
>
> Stachu 'Dozzie' K. wrote:
>> On 12.05.2006, Gary Wessle <phd...@yahoo.com> wrote:
>> > dear hackers
>> >
>> > I am looking at a console which is black background, ls -l some times
>> > puts different colors depending on some conf_file, well, is there a
>> > way to see all those colors at once shut and change any as I like.
>> >
>> > I find it very difficult to read directory names in dark blue with
>> > black background, I would like to keep the black background though.
>>
>> What system? On my Solaris ls don't print colors, just text.
>>
>> > googling ls -l "custom coloring" -> nothing
>>
>> You should have read man page instead of googling.
>>
>> --
>> Feel free to correct my English
>> Stanislaw Klekot
>
> I suspect that you're using Linux and using a client like Putty.

Yes, I use Linux (and Solaris), but I don't use PuTTY. And it's OP who
have problem, not me.

Sashi

unread,
May 12, 2006, 5:00:10 PM5/12/06
to

Well, I was talking to the OP, not you.
Also, it should "OP who has the problem". "Has" is used for singular
and have for plural.
(I felt free to correct your English). ;)
Sashi

Stachu 'Dozzie' K.

unread,
May 12, 2006, 5:10:37 PM5/12/06
to
On 12.05.2006, Sashi <smal...@gmail.com> wrote:
>
> Stachu 'Dozzie' K. wrote:
>> On 12.05.2006, Sashi <smal...@gmail.com> wrote:
>> >
>> > Stachu 'Dozzie' K. wrote:
>> >> On 12.05.2006, Gary Wessle <phd...@yahoo.com> wrote:
>> >> > dear hackers
>> >> >
>> >> > I am looking at a console which is black background, ls -l some times
>> >> > puts different colors depending on some conf_file, well, is there a
>> >> > way to see all those colors at once shut and change any as I like.
>> >> >
>> >> > I find it very difficult to read directory names in dark blue with
>> >> > black background, I would like to keep the black background though.
>> >>
>> >> What system? On my Solaris ls don't print colors, just text.
>> >>
>> >> > googling ls -l "custom coloring" -> nothing
>> >>
>> >> You should have read man page instead of googling.
>> >>
>> >> --
>> >> Feel free to correct my English
>> >> Stanislaw Klekot
>> >
>> > I suspect that you're using Linux and using a client like Putty.
>>
>> Yes, I use Linux (and Solaris), but I don't use PuTTY. And it's OP who
>> have problem, not me.
>>
>> --
>> Feel free to correct my English
>> Stanislaw Klekot
>
> Well, I was talking to the OP, not you.

Well, then why did you reply to _me_ instead of OP?

> Also, it should "OP who has the problem". "Has" is used for singular
> and have for plural.

Yeah, right. I still forget that. Maybe some day I'll learn to use
correct form of that verb. Thanks.

Gary Wessle

unread,
May 12, 2006, 7:59:50 PM5/12/06
to
"Sashi" <smal...@gmail.com> writes:

> Stachu 'Dozzie' K. wrote:
> > On 12.05.2006, Gary Wessle <phd...@yahoo.com> wrote:
> > > dear hackers
> > >
> > > I am looking at a console which is black background, ls -l some times
> > > puts different colors depending on some conf_file, well, is there a
> > > way to see all those colors at once shut and change any as I like.
> > >
> > > I find it very difficult to read directory names in dark blue with
> > > black background, I would like to keep the black background though.
> >
> > What system? On my Solaris ls don't print colors, just text.
> >
> > > googling ls -l "custom coloring" -> nothing
> >
> > You should have read man page instead of googling.
> >
> > --
> > Feel free to correct my English
> > Stanislaw Klekot
>
> I suspect that you're using Linux and using a client like Putty. I had
> the same problem.
> If you're using Linux and see dark blue colors for directory entries,
> do the following:

sorry, I should have indicated, it is debian / testing Linux 2.6.15-1-686


> Copy the file /etc/DIR_COLORS to your home directory (or anywhere else

I don't have such file.

> ...

Chris F.A. Johnson

unread,
May 12, 2006, 8:29:52 PM5/12/06
to
On 2006-05-12, Gary Wessle wrote:
[snip]

> sorry, I should have indicated, it is debian / testing Linux 2.6.15-1-686
>
>> Copy the file /etc/DIR_COLORS to your home directory (or anywhere else
>
> I don't have such file.

man dircolors

Create the file with:

dircolors -p > $HOME/.dircolors

Edit the file to taste.

In your .bashrc (and/or .bash_profile) put:

eval $(dircolors ~/.dircolors)

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence

Gary Wessle

unread,
May 12, 2006, 11:49:46 PM5/12/06
to
"Chris F.A. Johnson" <cfajo...@gmail.com> writes:

> On 2006-05-12, Gary Wessle wrote:
> [snip]
> > sorry, I should have indicated, it is debian / testing Linux 2.6.15-1-686
> >
> >> Copy the file /etc/DIR_COLORS to your home directory (or anywhere else
> >
> > I don't have such file.
>
> man dircolors
>
> Create the file with:
>
> dircolors -p > $HOME/.dircolors
>
> Edit the file to taste.
>
> In your .bashrc (and/or .bash_profile) put:

in my case it was .bashrc, placing the file in .bash_profile did not
do it, now I am getting the directories in bold yellow, thanks

Stephane CHAZELAS

unread,
May 13, 2006, 6:03:56 AM5/13/06
to
2006-05-12, 20:29(-04), Chris F.A. Johnson:
[...]

> In your .bashrc (and/or .bash_profile) put:
>
> eval $(dircolors ~/.dircolors)

eval "$(dircolors -b ~/.dircolors)"

--
Stéphane

0 new messages