在 Unix 中,
当我执行
$ find . -name 'Export.class' -print
显示,
The file access permissions do not allow the specified action.
find: 0652-081 cannot change directory to </usr/.ibm>:
错误不应显示在控制台中。只需要结果。
最佳答案
您是在问如何“关闭”错误吗?因为如果是这样,它是这样完成的:
$ find . -name 'Export.class' -print 2>/dev/null
这会将 stderr 重定向到/dev/null,这样您就看不到它,只留下结果。
关于unix find 命令结果中的权限问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5923086/