ls --color for hard links (wishlist)

Bug #123423 reported by Federico Poloni
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
coreutils (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: coreutils

It would help if ls --color marked in some way files which have more than one copy hardlinked -- that is, those who are not directories and have the value in the second column (with ls -l) greater than 1. For example, the value in the second column (number of hard links) could be highlighted.

Matt Zimmerman (mdz)
Changed in coreutils:
importance: Undecided → Wishlist
Revision history for this message
Kamil Dudka (kdudka) wrote :
Revision history for this message
Federico Poloni (fph) wrote : Re: [Bug 123423] Re: ls --color for hard links (wishlist)

> So I propose to add new ls color attribute to highlight files with more than
> one hardlink. What do you think?

I see your point and I agree that it is better to highlight the filename
than the number of links.

Changing to a new color, though, would lead to a minor problem, consider
this example:

executable file = green
non-executable file = white
non-exec' file with multiple hard links = $(NEW_COLOR)
exec' file with multiple hard links = ??? green or $(NEW_COLOR) ???

Only one information could be displayed, and if we have to choose, I
think the executable bit is more important that the information on the
number of hard links.
This could be fixed by changing the background color instead. The ls
coloring code already has the capability to change background colors, so
this would be simpler. So we would have

executable file = green
non-executable file = white
non-exec' file with multiple hard links = green with $(NEW_BACKGROUND)
exec' file with multiple hard links = white with $(NEW_BACKGROUND)

But this could lead to poor readability for some text/background
combinations.

Another possibility is changing attributes (bold/underscore/reverse),
but I am not sure how many terminals honor them. If they work on many
terminals, they could be the best choice.

Anyway, these were just my two cents, I am not an expert on this subject.
Thanks for your help and for your attention,

--federico

Revision history for this message
Kamil Dudka (kdudka) wrote :

Thank you for reply. Executable files should have higher priority than hard-linked files while highlighting. So in this case color of executable file is used. Theoretically you can have special color attribute for hard-linked executables, but this is not an usual case I think. As for the default color of hard-linked file, you can vote for it on bug-coreutils mailing list.

The patch was proposed upstream:
http://lists.gnu.org/archive/html/bug-coreutils/2008-10/msg00243.html

Revision history for this message
C de-Avillez (hggdh2) wrote :

Marking triaged, per Kamil's work. I was going to mark in progress, but I am not sure it would completely apply... We will keep an eye on it, anyway.

 BTW -- thank you, Kamil.

Changed in coreutils:
status: New → In Progress
status: In Progress → Triaged
Revision history for this message
C de-Avillez (hggdh2) wrote :

Marking as fix committed. Hopefully, we will get it on Jaunty.

Thanks (again ;-) Kamil.

Changed in coreutils:
status: Triaged → Fix Committed
Przemek K. (azrael)
Changed in coreutils (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.