[wplug] need help with command

Mark Dalrymple wplug at badgertronics.com
Thu Sep 11 14:08:22 EDT 2003


> Don't rememember if this was the list where there was a recent
> moderate-intensity flamewar over the use of -exec vs. xargs, so if it
> was, please accept my apologies for beating a dead horse:

it's a perfectly valid concern.  Since I'm always on my own machines,
or hideously overpowered servers, the -exec overhead isn't bad (unix
was designed to fork, after all).  If you're on a shared system and
want to be a good citizen, or are on something underpowered, then
xargs is the way to go.

Folks should be aware if the command being run by xargs is sensitive
to multiple invocations, since xargs will run a new one every couple
hundred files.

I got really burned by

find . ..whatever.. | xargs tar cf ~/something-important.tar

on a whole bunch of files, and the tarball only got the last couple
hundred files from the final tar run by xargs.

But stuff like grep, it's groovy.

Thanks for reminding me about xargs - I forget about it :-)
++Mark Dalrymple, markd at badgertronics.com.  http://badgertronics.com
  "Hitting age 50 and realizing that you've never pursued your dreams is
   one of the great horrors of the human condition. And totally
   inexcusable. Not following your passions is the greatest sin you can
   commit, it means surrendering the fire of your ambitions to the fears
   of other people. It's psychological treason."
    -- jms




More information about the wplug mailing list