GNU bug report logs - #71171
ls -U, -f: document the other half of the story too

Previous Next

Package: coreutils;

Reported by: Dan Jacobson <jidanni <at> jidanni.org>

Date: Fri, 24 May 2024 12:02:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#71171: closed (ls -U, -f: document the other half of the
 story too)
Date: Fri, 24 May 2024 15:50:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 24 May 2024 08:49:04 -0700
with message-id <98887352-bbf6-4c1e-b6af-2428b6f947ee <at> cs.ucla.edu>
and subject line Re: bug#71171: ls -U, -f: document the other half of the story too
has caused the debbugs.gnu.org bug report #71171,
regarding ls -U, -f: document the other half of the story too
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
71171: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71171
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Dan Jacobson <jidanni <at> jidanni.org>
To: bug-coreutils <at> gnu.org
Subject: ls -U, -f: document the other half of the story too
Date: Fri, 24 May 2024 10:32:04 +0800
Man ls says:
       -U     do not sort; list entries in directory order
Please make it say:
       -U     do not sort; list entries in the order they were given on
       the command line, and files within directories using their
       directories' order

And on (info "(coreutils) Sorting the output") please change:

‘-U’
‘--sort=none’
     Do not sort; list the files in whatever order they are stored in
     the directory.  (Do not do any of the other unrelated things that
     ‘-f’ does.)  This can be useful when listing large directories,
     where sorting can take some time.

to instead say:

‘-U’
‘--sort=none’
     Do not sort; list the files in the order they were given on the
     command line, and files within directories in whatever order they
     are stored in the directory. (Do not do any of the other unrelated
     things that ‘-f’, above, does.) This can be useful when listing
     large directories, where sorting can take some time.

Proof:

$ echo $PATH | tr -s : \\n
/home/jidanni/bin
/usr/local/sbin
/usr/local/bin
/usr/local/games
/usr/sbin
/usr/bin
/usr/games
/sbin
/bin
$ echo $PATH | tr -s : \\n | xargs ls -Uogd
drwxr-xr-x 1   632 05-24 05:47 /home/jidanni/bin
drwxr-xr-x 1     0 04-17 12:34 /usr/local/sbin
drwxr-xr-x 1     0 04-17 12:34 /usr/local/bin
drwxr-xr-x 1     0 04-17 12:34 /usr/local/games
drwxr-xr-x 1  6028 05-23 07:42 /usr/sbin
drwxr-xr-x 1 19542 05-23 20:01 /usr/bin
drwxr-xr-x 1     0 01-29 05:20 /usr/games
lrwxrwxrwx 1     8 04-17 12:34 /sbin -> usr/sbin
lrwxrwxrwx 1     7 04-17 12:34 /bin -> usr/bin

Above, -U thankfully allows me to keep the output in the order I gave it!

Wait,
man ls:
     -f     list all entries in directory order

Same problems all over again with -f documentation.

So please also update the man ls and Info ls "-f" discussions to include
the command line order, as I did above for -U. Thanks.

ls (GNU coreutils) 9.4


[Message part 3 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Dan Jacobson <jidanni <at> jidanni.org>
Cc: 71171-done <at> debbugs.gnu.org
Subject: Re: bug#71171: ls -U, -f: document the other half of the story too
Date: Fri, 24 May 2024 08:49:04 -0700
[Message part 4 (text/plain, inline)]
Thanks, I installed the attached. This doesn't exactly match your 
suggestion (as ls --help shouldn't be that chatty) but should address 
the issues you raised. Some of those issues had already been fixed in 
the development branch.
[0001-ls-improve-sorting-doc.patch (text/x-patch, attachment)]

This bug report was last modified 1 year and 57 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.