I need to get rid off "access denied" messages which fills my find output. I've read man find (maybe not too carefully, hit me) and cannot find anything like

-s/--silent or -q/--quiet command line key.


The easiest way would be to redirect find's errors with `2>/dev/null', but that may hide some errors you still might want to see, as chris_l mentioned.

If you want a cleaner solution, you can try something like

find foo/ \( -type d -and -not -executable -prune \) -o -print

which tells find not to descend into directories of which it cannot read the contents.

find /path -name "foo" 2>&1 | grep -v denied 

This will get rid of all Permission denied errors. Similarly you may edit the code above depending on the situation


find ... 2>/dev/null

(Note however, that this will redirect all errors, not just "access denied")

Your Answer

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