Delete .DS_Store files on MacOS
Batch Delete .DS_Store
Files
find /Users/$(whoami) -name ".DS_Store" -depth -exec rm {} \;
This command uses the find
command to search for all files named “.DS_Store” in the current directory (represented by the .
). The -depth
option ensures that it searches the subdirectories before the parent directory, and the -exec
option runs the rm
command on each file that is found.