0

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.

3 Answers 3

3

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.

1
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

0

find ... 2>/dev/null

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

You must log in to answer this question.