[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature request: add option to show directories first
From: |
Francesco Montorsi |
Subject: |
Re: Feature request: add option to show directories first |
Date: |
Sat, 03 Dec 2005 19:45:06 +0100 |
User-agent: |
Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) |
Hi,
Eric Blake wrote:
[The fact that you sent this request to the old bug-fileutils list instead
of bug-coreutils makes me wonder if you have the latest version of
coreutils. However, your request is still not present in CVS coreutils.]
sorry; I did not know that bug-fileutils was 'deprecated'
Hi,
I think that an option which lets the user to see the usual file listing
sorted
alphabetically, but with directory entries grouped before the files, would be
very useful.
You are not the first to request this feature. The problem is that no
one has been bothered enough by the lack of this feature to actually
contribute a patch.
ok, I understand; I could think to make a patch; unfortunately I'm very busy
now...
Things to think about - how would this option interact with other
sort options? For example, I think that the combination of
the proposed --directories-first (or whatever it gets spelled as)
alongside --sort=size would treat directories as a primary
sort key and size as a secondary sort key.
yes, that's the idea.
The --directories-first option would force ls to group all folders together at the
beginning, regardeless of the (secondary) sort key.
The group of the folders would then be sorted using the selected sort key; and same for
the files. This is the same approach for the "DIR" command of MSDOS:
http://www.computerhope.com/dirhlp.htm
(see /OG option)
Is there ever any
use for having another sort be the primary key and directory
status being the second key?
I'm not sure to understand; I think that if the user explicitely tells to LS to show the
directories as first entries, then 'directory status' should be always considered to be
the primary sort key...
Thanks,
Francesco