Skip to content

Instantly share code, notes, and snippets.

@jachin
Last active April 17, 2021 23:23
Show Gist options
  • Save jachin/1584418 to your computer and use it in GitHub Desktop.
Save jachin/1584418 to your computer and use it in GitHub Desktop.
Recursively delete (some) files.

Recursively delete CVS directories:

find . -depth -name 'CVS' -exec rm -rf '{}' \; -print

Remove .svn directories from a git repository:

find . -depth -name '.svn' -exec git rm --cached -r '{}' \; -print

Remove .pyc files:

find . -depth -name '*.pyc' -exec rm '{}' \; -print

Remove custom OS X iconts:

find . -depth -name 'Icon[^\w\W{1}]' -exec rm -rf '{}' \; -print

Remove .DS_Store files:

find . -depth -name '.DS_Store' -exec rm -rf '{}' \; -print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment