Skip to content

Instantly share code, notes, and snippets.

@dobsondev
Last active February 12, 2018 15:43
Show Gist options
  • Save dobsondev/83a6c60b15faa265de91 to your computer and use it in GitHub Desktop.
Save dobsondev/83a6c60b15faa265de91 to your computer and use it in GitHub Desktop.
Deletes all files in a directory except those with the extensions given.
find . -type f ! -name "*.<extension>" ! -name "*.<extension>" -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment