Delete .DS_STORE files in current folder and all subfolders from command line on Mac
find
can do that. Just add -delete
:
find . -name ".DS_Store" -delete
find . -name ".DS_Store" -print -delete
This will delete all the files named .DS_Store
in the current path while also displaying their relative paths
Here is how to remove recursively the .DS_Store
file
Open up Terminal In the command line, go to the location of the folder where all files and folders are:
cd to/your/directory
Then finally, type in the below command:
find . -name '.DS_Store' -type f -delete
Press Enter
Cheers!!
You can also use extended globbing (**
):
rm -v **/.DS_Store
in zsh, bash 4 and similar shells (if not enabled, activate by: shopt -s globstar
).