I understand that the -exec can take a + option to mimic the behaviour of xargs. Is there any situation where you'd prefer one form over the other? I personally tend to prefer the first form, if only to avoid using a pipe. I figure surely the developers of find must've done the appropriate optimizations. Am I correct?
Find -exec + vs find | xargs. Which one to choose?
find;pipe;xargs
You might want to chain calls to find (once, when you learned, that it is possible, which might be today). This is of course only possible as long as you stay in find. Once you pipe to xargs, it's out of scope. Small example, two files a.lst and b.lst: cat a.lstfuddel.shfiddel.shcat b.lstfuddel.shNo trick here - simply the fact that both contain fuddel but only one contains fiddel.Assume we didn't knew that. We search a file which matches 2 conditions: find -exec grep -q fuddel {} ; -exec grep -q fiddel {} ; -ls192097    4 -rw-r--r--   1 stefan   stefan         20 Jun 27 17:05 ./a.lstWell -maybe you know the syntax for grep or another program to pass both strings as condition, but that's not the point. Every program which can return true or false, given a file as argument, can be used here - grep was just a popular example. And note, you may follow find -exec with other find commands, like -ls or -delete or something similar. Note, that delete not only does rm (removes files), but rmdir (removes directories) too. Such a chain is read as a AND combination of commands, as long as not otherwise specified (namely with an -or switch (and parens (which need masking))). So you aren't leaving the find chain, which is a handy thing. I don't see any advantage in using -xargs, since you have to be careful in passing the files, which is something find doesn't need to do - it automatically handles passing each file as a single argument for you. If you believe you need some masking for finds {} braces, feel free to visit my question which asks for evidence. My assertion is: You don't. 