Is this faster: find /tmp -name core -type f | xargs /bin/rm -fthan doing this:find /tmp -name core -type f -exec /bin/rm -f {} \;So would using xargs increase overall speed?(I got the example from the man page of xargs.)
Is using xargs faster than not using it?
xargs
As Mat already said, in the general case you should be aware of the fact that every byte can be in a filename, except the NUL character (as it delimits the end of the string) and the / (as it deleimits path elements). So your xargs example should be (on a GNU system)find /tmp -name core -type f -print0 | xargs -0 /bin/rm -fEquivalent is a -exec in the find, but with a + instead of the \;.find /tmp -name core -type f -exec /bin/rm -f {} +This version doesn't call /bin/rm for every file, but bundles the arguments, just as xargs does.