Bug 116425

Summary: [patch] [request] ls(1) options for pre-sort of directories first or last, & listing of directories or non-directories explicitly
Product: Base System Reporter: Victor Vaile <bsdls>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: 6.2-STABLE   
Hardware: Any   
OS: Any   
Description Flags
file.diff none

Description Victor Vaile 2007-09-17 23:10:01 UTC
I seem to recall seeing a PR asking about one of these options quite some
time ago, however I didn't see any response posted back then, and my
search today did not yeild any results. (If this is a duplicate request,
my apologies are hereby included.)

The previous request had asked for a way to cause ls to return
directories first or last in the listing, with the various sorting
options applied to the directory, and non-directory groups individually.
In addition, I was looking for a way to get ls to output only
directories, or only non-directories.  I don't recall when I started to
use this initally, but I updated the patch that I used when I upgraded
a machine to 6.2-RELEASE.  I've just installed a machine with
6.2-STABLE-200708 last week, and used the same updated patch today which
still seems to work fine.

This is non-critical of course, and although I've not had the inclusion
of the options added effect anything adversly on any of the systems I've
installed it, I suspect there might be some discussion needed as to
whether such options should be included in the regular distribution.
I have found the options to be quite handy.

As there aren't many free single character command line options left,
my choices of options (D,V,N  for sorting directories first,last,no
sort[normal], and v,z,e for listing only directories, only non-directories,
everything [normal]) may not be all that intuitive, and could be changed
if desired.

Fix: I've included a patch that adds the features mentioned above to ls that works as of 6.2-STABLE-200708.  This also updates the manpage with the options added.

Patch attached with submission follows:
Comment 1 Jaakko Heinonen freebsd_committer 2010-01-30 08:33:39 UTC
See also bin/81837.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:29 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped