免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1298 | 回复: 3
打印 上一主题 下一主题

[服务应用] find使用问题[rhel5] [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-12-21 14:26 |只看该作者 |倒序浏览
find /  -type f -exec 'ls -h' {} \;
显示结果:
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
find: `ls -h': No such file or directory
……
系统输出全是这类信息。

如果去掉'ls -h'的-h参数,则可以正常显示找到的文件,WHY?

论坛徽章:
15
CU大牛徽章
日期:2013-03-13 15:32:35白羊座
日期:2013-10-30 13:11:16未羊
日期:2013-11-29 10:47:02白羊座
日期:2014-01-22 11:34:25白羊座
日期:2014-03-04 11:05:50申猴
日期:2014-07-29 16:31:36天秤座
日期:2013-10-23 15:33:47未羊
日期:2013-10-09 09:18:53CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55未羊
日期:2013-09-23 09:29:22
2 [报告]
发表于 2012-12-21 14:51 |只看该作者
-h放到外面。

论坛徽章:
3
程序设计版块每日发帖之星
日期:2016-02-23 06:20:0015-16赛季CBA联赛之八一
日期:2017-10-26 17:58:2515-16赛季CBA联赛之北控
日期:2017-11-02 10:50:56
3 [报告]
发表于 2012-12-21 14:52 |只看该作者
本帖最后由 过过招 于 2012-12-21 14:53 编辑

find /  -type f -exec ls -h {} \;

单引号无需

论坛徽章:
0
4 [报告]
发表于 2012-12-21 14:53 |只看该作者
谢谢,管用。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP