In a MacOS terminal I am trying to find files with the find command and to exclude the folder .Spotlight-V100/ . I tried

find . -name .Spotlight-V100/ -prune -o -type f


find . -path .Spotlight-V100/ -prune -o -type f


find .  -type f -not -path ".Spotlight-V100/"

but in all cases the find command lists files from inside the folder .Spotlight-V100/.

How to fix this command so the find command does not include and files in the folder and subfolders of the folder .Spotlight-V100/?

I also tried to remove that complete folder, but MacOS immediately recreates this folder for unknown reasons ...

1 Answer 1


In the first command, the name of the directory you want to prune is just '.Spotlight-V100' (without the trailing slash):

find . -name .Spotlight-V100 -prune -o -type f

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .