免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1489 | 回复: 5

about find parameter. [复制链接]

论坛徽章:
0
发表于 2003-05-24 13:19 |显示全部楼层
Dear all:

I want use "find" to somefile, but I only need to find current dir, not include other subdirs.

find /dir -type f -mtime 1

How can I do?

I am os is AIX 4.3.2.0

Thanks.

论坛徽章:
0
发表于 2003-05-24 19:21 |显示全部楼层

about find parameter.

...

-maxdepth 1

不知 AIX 上有没有

论坛徽章:
0
发表于 2003-05-24 20:55 |显示全部楼层

about find parameter.

I just to try ....

$ find . -name "*.txt" -maxdepth 1
find: 0652-017 -maxdepth is not a valid option.

but not support -maxdepth option

论坛徽章:
0
发表于 2003-05-24 21:28 |显示全部楼层

about find parameter.

论坛徽章:
0
发表于 2003-05-25 03:43 |显示全部楼层

about find parameter.

原帖由 "vantien" 发表:
I just to try ....

$ find . -name "*.txt" -maxdepth 1
find: 0652-017 -maxdepth is not a valid option.

but not support -maxdepth option


maybe you  should ask gurus in AIX board.

in case you can't get clue, try to use AWK to filter out unwanted subdirs.

$ find /dir -type f -mtime 1  | awk -F'/' '{ if (NF==2) print }'

hope it helps.

(i was always surprised that most important utilities for commercial unics are usually less powerful.)

论坛徽章:
0
发表于 2003-05-25 11:04 |显示全部楼层

about find parameter.

  

find . -type f -mtime 1 -print | awk -F'/' '{if (NF==2) print}'

It's work!!

Thank very much, Sir.

( I will go study awk ^_^ )
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP