Alexander Eremin schrieb:
On Wed, 2009-09-09 at 05:18 -0700, Davide wrote:
How can I delete files recursively in all subdirectories with .java extension?

Under ms-dos I used to execute this: 'del *.java /s'

I tried 'rm -rf *.java', on command line, but it didn't work,
it simply shows me the newer command line with a ready cursor.

Thanks in advance for any precious answer!
# cd YOUR_DIR

# find . -name *.java|xargs rm -rf

find <DIRECTORY> -type f -name '*.java' -exec rm {} +

Make sure you put quotes around the pattern you are searching, so that the shell doesn't accidently expand wildcards with files found in the current directory.

xargs isn't safe for filenames with whitespace characters in it.

You probably also don't want to delete directories, just plain files.


Daniel
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to