Reputation: 1097
I want to delete ._DS_Store file from the parent folder and all sub folders. How to delete the .DS_Store file recursively from all folders with single command? (using rm -rf command)
Upvotes: 13
Views: 15548
Reputation: 11186
To do this in the current directory you can do
find $(pwd) -name .DS_Store -delete
or other commands in place of -delete
as show in previous answer.
Upvotes: 2
Reputation: 14490
find parent_dir -name .DS_Store -delete
With GNU find at least. Otherwise
find parent_dir -name .DS_Store -print0 | xargs -0 rm -f
Or
find parent_dir -name .DS_Store -exec rm -f +
Upvotes: 28