Friday 5 February 2010

Recursive delete files/directories on OSX

When working with Java projects in Eclipse, or some other IDE, checked out from a source code repository such as CVS or SVN, you sometimes need to remove the IDE's project files or files created by the repository system. On the command line there's an easy way to do this using one of the following 2 code snippets:

  • Files: rm -rf `find . -name '*.project'`
  • Directories: rm -rf `find . -type d -name '.svn'`

1 comment:

  1. Just a bit less typing for the files case: find . -name \*.project -delete

    ReplyDelete