I am executing the following command:

find / -name ben

I've been wondering, why is there so many permission denied when running the above command? Even those directories that doesn't contain the name ben show up.

  • 2
    Because your find starts in the root directory of your system (/) and if you're not the root user you don't have permission to look into the most system relevant directories like /proc and so on. On the other hand, as root user you'll have the same message for user's home directories. – eblock May 26 '20 at 9:28

In order to search for a file, you need to be able to read all directories.

If a directory that is searched does not grant you read and "execute" permissions, you get a permission denied error from the find program.

If the read permission for you is missing, then you cannot see what files are in such a directory.

If the "execute" (search) permission is missing for you, then you cannot chdir into that diectory and as a result, you cannot ceck sub-directories in that directory.

Every operating system needs (for security reasons) directories that cannot be searched by ordinary people and other users may have closed their home directory as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.