Skip to content

Instantly share code, notes, and snippets.

@aroldodev
Created October 3, 2022 23:51
Show Gist options
  • Save aroldodev/f2b1bcd18f13268c855e02fcc896685f to your computer and use it in GitHub Desktop.
Save aroldodev/f2b1bcd18f13268c855e02fcc896685f to your computer and use it in GitHub Desktop.
Recursively Remove .DS_Store files in MacOS

Recursively Remove .DS_Store

1- Open up Terminal

2- In the command line, cd to/your/directory

3- 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment