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.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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.