Re:The power of find and xargs
by michaelcampbell on Friday July 09, 2010 @09:52AM
(#1500575)
Indeed. With zsh (and I guess more recent bash's), a lot of find is no longer necessary.
The real nugget in there is using xargs AT ALL. A lot of people don't know about it and continue with the -exec option of find. Which works fine still, but is horribly inefficient. Although to be fair, I haven't found this inefficiency to be even measurable (in real time-wasted units) unless the process being exec'd is slow to start.
Re:The power of find and xargs
by junklight on Friday July 09, 2010 @01:15PM
(#1501358)
Depends on how many files you have. In my line of work (web archiving) I frequently have more files than '*' can cope with - so need to use find even for mundane tasks
GNU Parallel http://www.gnu.org/software/parallel/ allows for replacing {} with multiple arguments. So this would do the right thing:
GNU Parallel is useful for many other applications. Watch the intro video to learn more: http://www.youtube.com/watch?v=OpaiGYxkSuQThe real nugget in there is using xargs AT ALL. A lot of people don't know about it and continue with the -exec option of find. Which works fine still, but is horribly inefficient. Although to be fair, I haven't found this inefficiency to be even measurable (in real time-wasted units) unless the process being exec'd is slow to start.