How to Recursively Remove .DS_Store
Lately, I’ve been doing a lot of theme development with plans to place themes on the WordPress.org repo, ThemeForest and other marketplaces. With that comes a lot of use of the Theme-Check plugin.
In order for your theme to pass the Theme-Check plugin review, you need to remove .DS_Store files from the theme folder. Doing that by hand is really boring, painful, and repetitive. Enter that awesome thing we call the command line.
Recursively Remove .DS_Store
- Open up Terminal
- In the command line,
- Finally, in the command line, type:
find . -name '.DS_Store' -type f -delete. Press enter.
Warning: Never use a wildcard (*) with this command, unless you know what you’re doing. Bad things can happen if you don’t.
This snippet will remove .DS_Store files from the selected folder, as well as all of the folders that it contains. All of them. At once.
This command can be used for other types of files, as well. Just replace
'.DS_Store' with whatever file name, or type, that you want to delete.
You can do this for other file types, as well. For example, you could use
I am a software engineer, teacher, speaker, and occasional writer. I live in the beautiful city of Denver, Colorado. You can follow me on Twitter at @jonbellah.