I've got a setup where I need to use 'find' to find 0 or more files in a certain directory, however, 'find' always produces an error when there are no files that match a certain check. Is it possible to run 'find' while having it omit errors when no files match the pattern?
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
Like @grawity said find isn't expected to report these errors. Anyway if you want to suppress error output redirect stderr to /dev/null:
One typical case in which find write to stderr happens when there is a directory in your find searching sub-path that hasn't the permission to be opened. |
||||
|
|
|
Can you just ignore the errors? Or, more specifically, redirect them to |
|||
|
finddoes not report such errors by default, at least not on my systems. – grawity Aug 21 '11 at 10:36