I often try to find files with following syntax:

find . -name "filetofind"

However it usually results as many rows or error reporting (Permission denied) about folders where permission is denied. Is there any other way to avoid this spam than using sudo or advanced grepping from error-output?

link|improve this question

43% accept rate
feedback

1 Answer

up vote 5 down vote accepted

Try

find . -name "filetofind" 2>/dev/null

This will redirect stderr output stream, which is used to report all errors, including "Access denied" one, to null device.

link|improve this answer
Thanks, works like a charm :) I suppose there is no easy way to make it default option without creating an alias doing the same. – user40167 Aug 24 '10 at 11:01
No, this is by design of the shell. – whitequark Aug 24 '10 at 11:10
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.