bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46060: Offer ls --limit=...


From: 積丹尼 Dan Jacobson
Subject: bug#46060: 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]