Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recursive erase hidden files

Tags:

unix

macos

I'm trying to recursive erase all files that begin with "._" (aka mac dot files) on my server using SSH. The files are listed with a ls -a but this won't work:

rm -rf ._*

I know there's a way. Mind to share? Cheers!

like image 645
Antonio Max Avatar asked Dec 30 '11 15:12

Antonio Max


2 Answers

find . -name ._\* -print0 | xargs -0 rm -f

like image 58
Paul Tomblin Avatar answered Oct 21 '22 19:10

Paul Tomblin


find . -name ._\* -type f -delete

Specify that it's files and just call the find-delete on item directly.

like image 27
Jerome Ajot Avatar answered Oct 21 '22 21:10

Jerome Ajot