GNU bug report logs -
#27127
Failure in "ls -t" when parameter list is long
Previous Next
Reported by: Teppo Mäenpää <tm <at> iki.fi>
Date: Sun, 28 May 2017 22:14:03 UTC
Severity: normal
Tags: notabug
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Mon, May 29, 2017 at 01:46:04AM +0100, Pádraig Brady wrote:
>> The command "ls -t" fails to sort files as promised, when the total length of
>> the names of the files to be listed (and sorted) exceeds 128 KB. All files
>> are still listed, just the sorting part stops working.
>
>128K is the defafult max arg size for xargs,
Thank you for your quick reply.
You are right, that was the cause of the problem.
>they have the --files0-from option to take input
...
>Now this option might be added to ls,
That would be wonderful.
>For example I've done this sort of ordering in the past
>with the `find | sort | xargs ls` pattern, which you can see in:
>http://www.pixelbeat.org/scripts/newest
Having the find-command print the timestamp is a great idea, which did not
cross my mind. Thanks!
======
Now, When I know it, I am able to find the 128KiB limitation from the man
page of xargs. However, in my opinion, that radically changes the behavior,
and the fact that xargs can cause multiple invocations should be mentioned in
the "DESCRIPTION" part of xargs manpage. xargs could also emit something to
standard error when it hits the boundary and splits the command line into
fractions.
Ways to proceed:
0) Close this ticket as stupid user error.
1) Convert this ticket into a feature request for "ls --files0-from"
2) Convert this to documentation enhancement / stderr verbosity increase request
for xargs
I am unsure which one of these would make most sense.
Thanks once more for the informative response!
Regards,
Teppo
This bug report was last modified 8 years and 73 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.