Allow find command to access the files

permissionterminal

I'm trying to use the find command to find a file on my Mac. However, when I used the command I accidentally denied my Mac permission to search my various folders, including documents and photos. How can I reverse this and give the terminal full permissions to search my computer?

The exact command I was using is:
find / -name "file_name".

Best Answer

There are two things you should do:

  1. Enable full Terminal access by opening System Preferences, selecting the Security Tab, selecting the last tab there, selecting Full Disk Access on the left and adding Terminal.app

enter image description here

  1. Run the command as

    sudo find / -name "file_name"
    

Assuming the file you are looking for is within your home folder

find ~ -name "file_name"

should also work (and is significantly faster).