[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Solved] ls color for bad symbolic link



On Wed, 15 Dec 2004 00:51:22 +0000, Jason Chambers wrote:

> On Tue, Dec 14, 2004 at 07:29:22PM -0500, Tong wrote:
>> On Sat, 11 Dec 2004 16:48:34 -0500, Tong wrote:
>> 
>> > I remember that my previous distro can distinguish symbolic links as good
>> > or bad: good links are show as normal link color whereas bad links are
>> > shown as red. 
>> > 
> 
> [snip]
> 
>> Ok, let's take a look at an example:
>> 
>> touch a
>> ln -s a l1
>> ln -s no l2
>> rm no
>> 
>> ls --color=auto
>> 
>> Do l1 and l2 show up in same color? 
>> 
>> In my Debian, they are, but in my RH, l2 show up red.
> 
> Have you tried doing a eval `dircolors -b` before the ls command?  This
> defines the LC_COLORS variable that is used to decide what colours are
> used.  You can get pretty colours for all sorts of things if you want to play
> about with dircolors but by default broken links are in red, and
> common image file extension in magenta etc.
> 
> IIRC it was already in the bashrc file - it just needed uncommenting.

Thank you very much Jason! 

Of all the replies, only yours give the correct answer to my problem

Just for the archive, as the result, before the eval, both my l1 and l2
are in magenta, whereas after the eval, l2 show up red.





Reply to: