Skip to content

Instantly share code, notes, and snippets.

@jazlopez
Last active August 3, 2016 08:48
Show Gist options
  • Save jazlopez/3d44a873340504cc6e154dccc6d570b6 to your computer and use it in GitHub Desktop.
Save jazlopez/3d44a873340504cc6e154dccc6d570b6 to your computer and use it in GitHub Desktop.
Remove files by pattern file name/extension
$find . -type f -name "FILE-TO-FIND" -exec rm -f {} \;
# -iname "FILE-TO-FIND" : File pattern, case insensitive, e.g. -iname “*.png”, match all png files
# -exec rm -rf {} \; : Delete all files matched by file pattern.
# -type f : Only match files and do not include directory names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment