[Top][All Lists]

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

add find -limit, xargs --limit

From: 積丹尼 Dan Jacobson
Subject: add find -limit, xargs --limit
Date: Sun, 13 Nov 2016 07:57:21 +0800

Gentlemen, just like the SQL language has a "LIMIT" operator, so also
does find need a -limit (and xargs a --limit) option.

You might ask can't one just use e.g.,
$ find|sed 3q
$ some_command|sed 3q|xargs ...

and e.g.,
$ find -print0 | perl -0nwe 'print; exit if $. == 3;' | xargs -0 ...
if needing to use nulls.

Well yes one can, but
1. at least give the null example on the man pages.
2. wouldn't it be much more efficient if the commands stopped output
themselves? Like
$ find -limit 3 -print0 | xargs -0 ...
$ any_command | xargs --limit 3

reply via email to

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