I'm running this command:

cleber@ubuntux:~$ find . -name "*log*" -name "*2016*"
find: ‘./.cache/dconf’: Permission denied
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.

  • @George It's not a good idea to excursively change permissions in system generated folders. Many of them requires restricted rigths to function correctly. – Soren A Dec 21 '16 at 13:38
  • 4
    @George chmod 777 is like Vodka, first you think it solves all your problems, but soon you'll wake up with a massive headache. Avoid it. – Byte Commander Dec 21 '16 at 13:41
  • If he has issues in his / that's a different matter but in his /home directory it should be so. All files and folders there should be accessible to the owner [in this case Holanda]. – George Udosen Dec 21 '16 at 13:42
  • 1
    @ByteCmmander, yes I was using that as an example as to how to use -R option to set permissions deep in the folder not asking he use that. Holanda please take note. – George Udosen Dec 21 '16 at 13:43
  • 1
    @Videonauth, Yes I felt that way too that's why I got rid of it, lest some one uses it. – George Udosen Dec 21 '16 at 13:54

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

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.