recursive delete question

Hello all!

I need to recursively delete directories which contain files matching *.abc

So in an example directory structure such as this...

/directory/

/directory/test1/

/directory/test2/temp.abc

/directory/test3/

/directory/test4/subdirectory1/

/directory/test4/subdirectory2/temp.abc

thetest2 andtest4/subdirectory2 directories would be deleted (and their contents of course). Any idea how this would be accomplished?

[503 byte] By [adoxtatera] at [2007-11-27 11:59:06]
# 1

rm -rf `find <directory> -type d -name "*.abc"`

might would do the trick, but its probably a good idea to test the find first, and maybe run rm -ri rather than -rf..

.7/M.

mAbrantea at 2007-7-29 19:23:41 > top of Java-index,General,Talk to the Sysop...