Can U pipe filenames to rm???

Bob McGowen x4312 dept208 bob at wyse.wyse.com
Sat Oct 6 10:22:35 AEST 1990


In article <941 at hls0.hls.oz> george at hls0.hls.oz (George Turczynski) writes:
>From previous postings-
>
>> >Example:
>> >  find {{stuff here}} -print | xargs rm -f

...deleted examples and discourse

>Why use `xargs' when you don't need to ?

Because the -exec for find will run the rm on a file by file basis.
If you find many matches to the pattern you have the overhead and
system load generated by an exec of rm for each file found.  Using
xargs can reduce the number of execs quite a bit and so would be
useful where you expect lots of files found or on a system with
heavy 24 hour usage.  In other cases, you would certainly not need
it, as you note.

Bob McGowan  (standard disclaimer, these are my own ...)
Product Support, Wyse Technology, San Jose, CA
..!uunet!wyse!bob
bob at wyse.com



More information about the Comp.unix.shell mailing list