Last active
January 3, 2022 19:13
-
-
Save joshuacerbito/be6ac34145e56102991fd822652b9903 to your computer and use it in GitHub Desktop.
Recursively find (and delete) all files of the same type in current directory
This file contains hidden or 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
# Recursively find all files of the same type in current directory | |
find . -name "*.bak" -type f | |
# Recursively find and delete all files of the same type in current directory | |
find . -name "*.bak" -type f -delete | |
# Print out a list of directories to be deleted: | |
find . -name 'node_modules' -type d -prune | |
# Delete directories from the current working directory: | |
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment