免费注册 查看新帖 |

Chinaunix

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

[文件目录] find . -name -i confing* 这个脚本什么地方有问题? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-03-14 17:02 |只看该作者 |倒序浏览
   主要是不想区分大小写。

论坛徽章:
2
射手座
日期:2014-10-10 15:59:4715-16赛季CBA联赛之上海
日期:2016-03-03 10:27:14
2 [报告]
发表于 2013-03-14 17:06 |只看该作者
回复 1# bigacer


   find -iname "config*"

论坛徽章:
32
处女座
日期:2013-11-20 23:41:20双子座
日期:2014-06-11 17:20:43戌狗
日期:2014-06-16 11:05:00处女座
日期:2014-07-22 17:30:47狮子座
日期:2014-07-28 15:38:17金牛座
日期:2014-08-05 16:34:01亥猪
日期:2014-08-18 13:34:25白羊座
日期:2014-09-02 15:03:55金牛座
日期:2014-11-10 10:23:58处女座
日期:2014-12-02 09:17:52程序设计版块每日发帖之星
日期:2015-06-16 22:20:002015亚冠之塔什干火车头
日期:2015-06-20 23:28:22
3 [报告]
发表于 2013-03-14 17:08 |只看该作者
你那样是不行的~用这个吧:
  1. find . -iname "confing*"
复制代码

论坛徽章:
33
ChinaUnix元老
日期:2015-02-02 08:55:39CU十四周年纪念徽章
日期:2019-08-20 08:30:3720周年集字徽章-周	
日期:2020-10-28 14:13:3020周年集字徽章-20	
日期:2020-10-28 14:04:3019周年集字徽章-CU
日期:2019-09-08 23:26:2519周年集字徽章-19
日期:2019-08-27 13:31:262016科比退役纪念章
日期:2022-04-24 14:33:24
4 [报告]
发表于 2013-03-14 17:10 |只看该作者
不要自己发明语法
       -iname pattern
              Like  -name,  but  the  match is case insensitive.  For example, the patterns ‘fo*’ and ‘F??’ match the file names ‘Foo’, ‘FOO’, ‘foo’, ‘fOo’, etc.   In these pat-
              terns, unlike filename expansion by the shell, an initial ‘.’ can be matched by ‘*’.  That is, find -name *bar will match the file ‘.foobar’.    Please  note  that
              you should quote patterns as a matter of course, otherwise the shell will expand any wildcard characters in them.

论坛徽章:
0
5 [报告]
发表于 2013-03-14 17:12 |只看该作者
@bigacer
  1. [root@Wed ~]# man find | grep -A 3 iname
  2.        -iname pattern
  3.               Like -name, but the match is case insensitive.  For example, the
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP