[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#27127: Failure in "ls -t" when parameter list is long
From: |
Teppo Mäenpää |
Subject: |
bug#27127: Failure in "ls -t" when parameter list is long |
Date: |
Mon, 29 May 2017 07:20:02 +0300 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
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