Last active
December 27, 2019 21:58
-
-
Save MakGulati/889f136d311de32123338274642e9216 to your computer and use it in GitHub Desktop.
regex find and delete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#find all files that are .png or .jpg and delete them | |
find . -type f \( -name "*.jpg" -o -name "*.png" \) -delete | |
#find all files that are not .png or .jpg and delete them | |
find . -type f ! \( -name "*.jpg" -o -name "*.png" \) -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment