This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a directory ../classes under which i have a lot of subdirectories ../classes/com/financial/argon ../classes/com/financial/argon/util ../classes/com/orion/util ............... ............ All these directories contains java & class files now i want to remove all the java files which is any where in this directory structure by giving a command from ../classes I tried as follows rm -Rf *.java & rm -rf *.java but it doesn't work
I just want to know is there any body call my bean's Getter and Setter methods with "Please" in front - My favorite quip from Bugzilla
If you would like to delete a directory and all of it's subdirectories, type rm -rf <directory> so if i wanted to delete my entire usr directory, I would type rm -rf /usr be careful, this isn't windows, if you type rm -rf /, it will delete everything without warning because -f means force (no matter what) post another message if that doesn't do the trick
Anoop, I dont know whether it can be done by a single unix command. But the alternative is to write a simple shell/PERL script which takes the directory name, goes through all the files/directories which lie below it, and delete those having extention '.java' Amol
find . -name "*.java" -print0 | xargs -0r rm -f The "find" command is a treasure too little known. I got the above text by doing "info find", selecting "common tasks" then "cleaning up". Actually, I think I have been getting away with a shorter version: find . -name "*.java" | xargs rm -f But I'd test that someplace harmless, first.
An IDE is no substitute for an Intelligent Developer.
I use ant build in task "Delete" to do the same, and it is platform independent.
However, Tim's way works great!!! Learn something new everyday. Thanks a lot! SCJD Study Group has been moved to http://www.developergroup.org/ [This message has been edited by Roseanne Zhang (edited September 29, 2001).]
I wrote a java program that recursively goes through sub-directories deleting files of a user-defined suffix. I use it to clear out old .class files. I can send it to you if you post your e-mail address. Eric.