Linux 查找不显示错误信息的命令

Linux Find command without display error messages

我必须创建以下 find 命令,但我做不到。

Search the entire file system all files that end with ".h" or ".so" without display error messages due to lack of access rights to the file (permission denided). It is not allowed use sudo to run the find command, (obviously root access) and even redirect standard error to / dev / null Blockquote

如有任何帮助,我们将不胜感激。谢谢。

使用 gnu find 你可以做到:

find / -type d ! -readable -prune -o \( -name '*.so' -o -name '*.h' \) -print

-type d ! -readable -prune 将跳过用户无法读取的目录 运行 此 find 命令。