Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to delete a file recursively from folders on mac / unix

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)

like image 595
sfbayman Avatar asked Nov 16 '15 03:11

sfbayman


Video Answer


1 Answers

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 +
like image 57
Eric Renouf Avatar answered Oct 14 '22 11:10

Eric Renouf