Find without the "Permission non granted" list ...

Hi,

When I use the Find command under the root directory ("/") of my Ubuntu, I get the good answers mixed inside a long list of "Permission non granted" (in fact and with my French version, I get "Permission non accord�e" !).

After several unsuccessful tries with -perm or -executable options (or with -prune action), I've found no simple way to avoid that. Maybe not so simple ... :frowning:

My goal : Turning off the warnings given by 'find' started on any directory of the system, and typically "/". These warnings "pollute" the result inusefully !

Thank's for your help,

Micla

Hi.

You could always just throw the errors away:

find / ..... 2> /dev/null

Well ... I should have been more precise in my initial question (maybe I'm slightly purist too !) :

I'm looking for a way to do that job inside the find command, so as to avoid external processings, such as shell ones.

In the case where "Find" would bring other interesting warnings on the error output, I would like to be able to catch them. I am really looking for an inside-find solution to remove selectively these particular warnings ...! ;-/

And I must say that I am surprised to see the great amount of particular case taken in account in "find" and nothing (at least found by me) for this seemingly-simple pb !!!

Hi,

I don't know if this solution could be useful to you, but I would discard the result using 'awk'. Here a sample in my own system. The regular expresion of 'Permission not granted' is in spanish, but change it for your needs:

find / -iname "*pacman*" -print 2>&1 | awk 'BEGIN {IGNORECASE=1;} $0 !~ /permiso denegado/ {print}'

Regards,
Birei

As per my experience. On Ubuntu even with admin user you are not allowed to access all files by default.
Either become root by executing "sudo su -"
or run find command with sudo

sudo find / .... XYZ

If you still wish to run it without sudo

find ./ .... XYZ 2> /tmp/perm.txt