在Unix中,
当我执行时
$ find . -name 'Export.class' -print
Run Code Online (Sandbox Code Playgroud)
显示,
The file access permissions do not allow the specified action.
find: 0652-081 cannot change directory to </usr/.ibm>:
Run Code Online (Sandbox Code Playgroud)
错误不应该显示在控制台中.只需要结果.
你在问如何"关闭"错误吗?因为如果是这样的话,就像这样:
$ find . -name 'Export.class' -print 2>/dev/null
Run Code Online (Sandbox Code Playgroud)
这会将stderr重定向到/ dev/null,这样您就不会看到它,只留下结果.