Re: [dev] Why not use the -exec feature of find?

From: Nikita Zlobin <nick87720z_AT_gmail.com>
Date: Sat, 3 Jul 2021 11:14:56 +0500

In Sat, 03 Jul 2021 06:52:54 +0300
Greg Minshall <minshall_AT_umich.edu> wrote:

Replying to topic start, which is not in my local ingoing dir.

There's only one advantage for find... -exec method: compatibility and
lower processes number. It runs command for each single argument.

Two reasons for xargs to be more effective:
1 - As said in previous reply, it may be parallelized with --max-procs
(note, default is 1);
2 - It tries to append as much as possible arguments to each command,
while in system limits. They include not only arguments number,
but also command and argument lengths. Try this command to see:

ls -1 | xargs --show-limits echo
Received on Sat Jul 03 2021 - 08:14:56 CEST

This archive was generated by hypermail 2.3.0 : Sat Jul 03 2021 - 08:36:07 CEST