--- Begin Message ---
Subject: |
Offer ls --limit=... |
Date: |
Sun, 24 Jan 2021 05:13:17 +0800 |
I hereby propose "ls --limit=..."
$ ls --limit=1 # Would only print one result item:
A
You might say:
"Jacobson, just use "ls|sed q". Closed: Worksforme."
Ah, but I am talking about items, not lines:
$ ls
A B C D
E F G H
I J K L
$ ls -C|sed 2q
A B C D
E F G H
$ ls -C --limit=2
A B
$ ls --limit=2
A B
Indeed, directories might be huge. And any database command already has
a --limit option these days, and does not rely on a second program to
trim its output because it can't control itself. Indeed, on some remote
connections one would only want to launch one program, not two. Thanks.
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#46060: Offer ls --limit=... |
Date: |
Mon, 25 Jan 2021 14:48:13 +0800 |
>>>>> "PE" == Paul Eggert <eggert@cs.ucla.edu> writes:
PE> That argument would apply to any program, no? "cat", "diff", "sh",
PE> "node",....
PE> Not sure why "ls" needs a convenience flag that would complicate the
PE> documentation and maintenance and be so rarely useful.
OK, then I'll close the bug then.
--- End Message ---