4 ms·
In my opinion, xargs has really niche use cases, and -exec is way more fit for general use. - There's the issue of command line length, pipe too many files and
by marcosdumay 9y ago
In my opinion, xargs has really niche use cases, and -exec is way more fit for general use.
- There's the issue of command line length, pipe too many files and xargs will just fail.
- There's predictibility. With -exec you get to see the entire command line structure, what is escaped, what is not, what names go where. With xargs, a couple of badly named files and you are out of luck.
- Find's syntax is just more general. Xarg is limited to pushing parameters into a script, while -exec can run whatever scrit you want, with single or multiple parameters, or flags, or whatever.
Performance is almost never an issue.