how do you use rm to del found files
Gerald Combs
gerald at ethereal.com
Thu Jun 27 15:15:06 CDT 2002
On Thu, 27 Jun 2002 dattaway at attaway.net wrote:
> On Thu, 27 Jun 2002, Gene Dascher wrote:
>
> > This should do it for you:
> >
> > find . -name "*.class" -exec rm -rf {} ; -print
>
> or use the handy backticks, which runs the commands placed within them,
> returning its output in its place:
>
> rm `find . -name *.class -print`
>
> ...useful in many other ways, such as playing all mp3's that have "friday"
> in the title:
>
> xmms `find /mp3 | grep -i friday`
...or use the "xargs" command:
find . -name "*.class" | xargs rm -rf
which isn't very different from Gene's answer unless you have the
misfortune of running Ultrix. The ";" argument didn't work when I used
Ultrix. Dunno if they ever fixed it.
More information about the Kclug
mailing list