Last active
October 19, 2018 10:45
-
-
Save wikiti/6e576c8e7cc34d1dc1be5bc08d890633 to your computer and use it in GitHub Desktop.
Use find command to search and delete/remove files by name (globs). This can be useful to remove temporary files.
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
# Find files by name | |
find path/to/folder -name <name or pattern> | |
# Find files and remove by name | |
find path/to/folder -name <name or pattern> -exec rm {} \; | |
# Examples | |
find ~/secrets -name super_secret.txt | |
find ~/images -name *.png | |
find ./ -name *.orig* | |
find ./ -name *.orig* -exec rm {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment