Joe Brenner <[EMAIL PROTECTED]> writes:
> For some reason, the function of xargs will not sink into my
> head...
What xargs does is take a list of things on standard input (usually
files) and run the command specified, putting as many of those files
(or whatever) on each command line, until the command has been run for
each file.
So, if you had a directory of ten thousand files, not all of them
might fit on the command line (I think it's a kernel limit or
something). xargs knows how long the command line limit is, and will
take the first 50 (for instance) and run rm once, take the next 50 and
run rm again, and so on, until rm has been run on all the files.
This is different from find because it doesn't exec rm once for each
file, so it should be as efficient as possible. (That's the theory,
at least.)
In general, you'd run into the "Argument list too long" more on other
unices, since Linux has a healthy limit.
xargs with the -0 option can also be useful when you have a list of
files with spaces in the name.
--
Alan Shutko <[EMAIL PROTECTED]> - In a variety of flavors!
74 days, 15 hours, 1 minutes, 50 seconds till we run away.
System restarting, wait...
_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list