Permission Denied running find command

I'm running this command:

cleber@ubuntux:~$ find . -name "*log*" -name "*2016*"
./log-2016-05-04.txt
./log-2016-05-03.txt
./log-2016-05-08.txt
./log-2016-05-02.txt
./log-2016-05-05.txt
find: ‘./.cache/dconf’: Permission denied
./log-2016-05-01.txt
./log-2016-05-06.txt
./log-2016-05-09.txt
./log-2016-05-07.txt
./log-2016-05-10.txt
find: ‘./.dbus’: Permission denied

Why am I getting the "Permission denied" error? All my permission setting on /home/cleber are set correctly. Someone can help me? Thank you.

9

1 Answer

Looks like you have some folders with incorrect owners (or maybe permissions) in your home directory.

The Permission denied warning means that find could not search in a specific folder because it did not have the permissions to list its content, obviously.

In your home directory, the most likely cause is that you were running some GUI applications with sudo that messed up file ownerships. To fix this and make you the owner of all files in your home directory again, run this:

sudo chown -R $USER ~

Otherwise, if you are sure all permissions and ownerships are correct and you don't want to modify anything, you can also just hide the warning from the output by appending a STDERR redirection to /dev/null to your find command:

find . -name "*log*" -name "*2016*" 2> /dev/null
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like