Linux find command Permision or Access Denied error message.

Excluding the  "permission denied" or "Access denied" message is quite simple.

When the find command is executed with lack of permissions, all the errors saying "permission denied"  are sent to the stderr.
There is a way of redirecting all this errors to the void. that's the /dev/null device.

example of a find execution:

find ./ -iname '*.jpg' -print 2> /dev/null

./2012/07/08/DSC_0113.JPG
./2012/07/08/DSC_0103.JPG
./2012/07/08/DSC_0124.JPG
./2012/07/08/DSC_0107.JPG
./2012/07/08/DSC_0115.JPG


And that's it ! ! !

here is the video of this exact example




No more permission-related errors.

This is a good practice if you are coding in linux using the find command for bash scripting or perhaps you want to create your own find GUI.

Thank you for stopping by.




2 ads