当前位置: 技术问答>linux和unix
linux重定向不起作用了
来源: 互联网 发布时间:2016-11-17
本文导语: $ find . -type f | xargs grep RunCRSync 2>/dev/null find: cannot read dir ./lost+found: Permission denied find: cannot read dir ./usr/lost+found: Permission denied find: cannot read dir ./usr/aset: Permission denied find: cannot read dir ./usr/local/mys...
$ find . -type f | xargs grep RunCRSync 2>/dev/null
find: cannot read dir ./lost+found: Permission denied
find: cannot read dir ./usr/lost+found: Permission denied
find: cannot read dir ./usr/aset: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/bm_n: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/crinfo: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/labadministration: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/bm: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/statisticreport: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/confluencedb: Permission denied
find: cannot read dir ./usr/local/webmin/log: Permission denied
find: cannot read dir ./usr/local/news.old/run: Permission denied
find: cannot read dir ./usr/local/apache/conf/ssl.key: Permission denied
find: cannot read dir ./usr/openv/netbackup/logs/user_ops/root: Permission denied
find: cannot read dir ./usr/openv/netbackup/bin/bprd.d: Permission denied
find: cannot read dir ./usr/openv/netbackup/bin/bpdbm_child: Permission denied
find: cannot read dir ./usr/openv/netbackup/bin/bpdbm_parent: Permission denied
find: cannot read dir ./usr/openv/netbackup/bin/bprd_child: Permission denied
明明把标准错误重定向了,怎么还在打印这些乱七八糟的东西啊??
find: cannot read dir ./lost+found: Permission denied
find: cannot read dir ./usr/lost+found: Permission denied
find: cannot read dir ./usr/aset: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/bm_n: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/crinfo: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/labadministration: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/bm: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/statisticreport: Permission denied
find: cannot read dir ./usr/local/mysql-max-4.1.8-sun-solaris2.9-sparc/data/confluencedb: Permission denied
find: cannot read dir ./usr/local/webmin/log: Permission denied
find: cannot read dir ./usr/local/news.old/run: Permission denied
find: cannot read dir ./usr/local/apache/conf/ssl.key: Permission denied
find: cannot read dir ./usr/openv/netbackup/logs/user_ops/root: Permission denied
find: cannot read dir ./usr/openv/netbackup/bin/bprd.d: Permission denied
find: cannot read dir ./usr/openv/netbackup/bin/bpdbm_child: Permission denied
find: cannot read dir ./usr/openv/netbackup/bin/bpdbm_parent: Permission denied
find: cannot read dir ./usr/openv/netbackup/bin/bprd_child: Permission denied
明明把标准错误重定向了,怎么还在打印这些乱七八糟的东西啊??
|
这是grep的标准错误信息,也需要重定向下。。这样吧
find . -type f 2>/dev/null | xargs grep RunCRSync 2>/dev/null