Skip to main content
edited body
Source Link
Kusalananda
  • 356.2k
  • 42
  • 737
  • 1.1k
find top-folder -type f -name "'.DS_Store"DS_Store' -exec rm -f {} + 

or, more simply,

find top-folder -type f -name "'.DS_Store"DS_Store' -delete 

where top-folder is the path to the top folder you'd like to look under.

To print out the paths of the found files before they get deleted:

find top-folder -type f -name "'.DS_Store"DS_Store' -print -exec rm -f {} + 
find top-folder -type f -name ".DS_Store" -exec rm -f {} + 

or, more simply,

find top-folder -type f -name ".DS_Store" -delete 

where top-folder is the path to the top folder you'd like to look under.

To print out the paths of the found files before they get deleted:

find top-folder -type f -name ".DS_Store" -print -exec rm -f {} + 
find top-folder -type f -name '.DS_Store' -exec rm -f {} + 

or, more simply,

find top-folder -type f -name '.DS_Store' -delete 

where top-folder is the path to the top folder you'd like to look under.

To print out the paths of the found files before they get deleted:

find top-folder -type f -name '.DS_Store' -print -exec rm -f {} + 
Source Link
Kusalananda
  • 356.2k
  • 42
  • 737
  • 1.1k

find top-folder -type f -name ".DS_Store" -exec rm -f {} + 

or, more simply,

find top-folder -type f -name ".DS_Store" -delete 

where top-folder is the path to the top folder you'd like to look under.

To print out the paths of the found files before they get deleted:

find top-folder -type f -name ".DS_Store" -print -exec rm -f {} +