unix find 命令结果中的权限问题

标签 unix find

在 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/

相关文章:

Unix 删除指定目录下的所有文件夹

Unix 和 tee — 命令链

c++ - 为什么此代码在找到后不突出显示搜索词?

c++ - 问题解析字符串

node.js - 运行 .env 文件并从 Node 访问它们

javascript - 使用 array.find() 在 javascript 数组中查找元素

linux - CMake find_path 适用于 Linux 但不适用于 MingW。我该如何解决?

linux - 验证通过 Jumpbox 登录服务器以获得应用程序支持的能力(ssh 多跳)

c - 接收 SIGTERM

c++ - 时区问题 : `$ date -R` says `+0300` , 但 `timezone` 表示 `-7200`