l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2004 Apr 28 12:44

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Bash scripting newbie - need syntax help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Bash scripting newbie - need syntax help

Bill Kendrick wrote:

Say you had files "deleteme", "metoo" and "imouttahere"

 find . -type f -exec rm {} \;

would cause this to happen:

 rm deleteme
 rm metoo
 rm imouttahere

whereas the xargs method:

 find . -type f | xargs rm

would cause this:

 rm deleteme metoo imouttahere

A bit quicker; less process forking, yada-yada-yada.

great explaination, gracias. is there ever a chance that the set of information piped off to xargs could become too big?

for example:

find . -type f -exec rm {} \;
rm 1
rm 2
rm 6,000,000


find . -type f | xargs rm [where xargs has to push 6 million things at rm and things get whacky fast]

it seems (but i have no idea) that find would handle this one rm process at a time, and though handling it slower, would struggle though it better than xargs might with one huge data set.

just a thought. most of my uses of find involve web directories with say 5-60 html files, so i doubt i'd ever create this scenario...

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.