grep {6} 但是我收到一条错误-6ren">
gpt4 book ai didi

linux - 查找固定长度的文件

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:47:14 25 4
gpt4 key购买 nike

我正在尝试查找以字母“a”开头且长度为 6 的文件名。我尝试了多种变体,最新的变体是:

find /usr/bin -type f -regex "^[a]" > grep {6}

但是我收到一条错误消息:

find: paths must precede expression: {6}
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]

我做错了什么?

最佳答案

没有任何正则表达式,只是 globbing:

find /usr/bin -type f -name 'a?????'

引用资料:

关于linux - 查找固定长度的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34776735/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com