Last active
November 10, 2022 02:55
-
-
Save tomhopper/44dde3e8788bb82a4001 to your computer and use it in GitHub Desktop.
Use the Mac OS X terminal (UNIX command line) to find and delete all files matching a pattern
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 . -name '.filename' -print -exec rm -r {} \; | |
| # . = in current directory | |
| # -name = file name to find | |
| # -print = print the result's full file name to standard output | |
| # -exec = execute the following command | |
| # {} = fill in with the result of standard output | |
| # \; = semicolon to terminate the -exec command, and the escape | |
| # character so that the terminal doesn't treat the semicolon as a | |
| # return character (used for stringing together multiple commands). | |
| # Add '-d' to find directories. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment