Skip to content

Instantly share code, notes, and snippets.

@paulboardman
Created June 5, 2013 15:53
Show Gist options
  • Save paulboardman/5714993 to your computer and use it in GitHub Desktop.
Save paulboardman/5714993 to your computer and use it in GitHub Desktop.
find command for finding and removing empty directories/files whilst ignoring certain dirs (in this case the knime tree).
# first print out the files/dirs
find . -path "*/knime/*" -prune -or -empty -print
# if you're happy with the list then we can get rid of them
find . -path "*/knime/*" -prune -or -empty -print | xargs rm -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment