Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在我的 linux 控制台上进行搜索find /export/home01/ -name sql | grep -v 'Permission denied'
find /export/home01/ -name sql | grep -v 'Permission denied'
但是,它未能过滤掉“权限被拒绝”的行
喜欢显示find: /export/home01/oracle/oracle/product/11.2.0/db_1/network/log: Permission denied.
find: /export/home01/oracle/oracle/product/11.2.0/db_1/network/log: Permission denied
我的命令有什么问题?
这是意料之中的:您只是在过滤stdout,但错误消息(通常)会转到stderr。试试这个:
stdout
stderr
find /export/home01/ -name sql 2>&1 | grep -v 'Permission denied'