Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 查找不';当试图查找某些文件时,请不要给我输出_Linux_Bash_Find - Fatal编程技术网

Linux 查找不';当试图查找某些文件时,请不要给我输出

Linux 查找不';当试图查找某些文件时,请不要给我输出,linux,bash,find,Linux,Bash,Find,我想找到这些文件: 智能用户04.csv 智能用户07.csv 当我输入以下内容时: find-键入f-regex“\bsmart\susers\d{2}\.csv\b” 它不返回任何内容请尝试以下操作: find . -type f -regex ".*smart users..\.csv" 或: 甚至: find . -type f -regextype egrep -regex ".*smart users[[:digit:]]{2}.csv". 见对问题的评论;) 只有\b对任何

我想找到这些文件:

  • 智能用户04.csv
  • 智能用户07.csv
当我输入以下内容时:

find-键入f-regex“\bsmart\susers\d{2}\.csv\b”

它不返回任何内容

请尝试以下操作:

find . -type f -regex ".*smart users..\.csv"
或:

甚至:

find . -type f -regextype egrep -regex ".*smart users[[:digit:]]{2}.csv".
见对问题的评论;)


只有\b对任何find的regextype有效\在GNU的“查找信息”页面中可以看到,s和\d都不在其中。另请参见、、等
find-键入f-regex“*smart.users..\.csv”
或者:
find-键入f-regex“*smart.users[0-9][0-9]\.csv”
。甚至
查找-类型f-regextype posix extended-regex'.*\b智能用户[0-9]{2}\.csv\b'
;D有趣的一点是,即使任何regextype知道\d,它仍然会失败,因为作为最小输出,始终存在与wordboundry要求不匹配的前导
/
查找-键入f-regextype posix extended-regex“*\bsmart users[0-9]{2}\.csv\b”| cut-c3-
,它将从smart开始生成结果,而不必调用第二个工具,只需执行
查找即可-类型f-regextype posix extended-regex“*\b智能用户[0-9]{2}\.csv\b”-printf“%f\n”
=)
find . -type f -regextype egrep -regex ".*smart users[[:digit:]]{2}.csv".
find . -type f -regextype posix-extended -regex '.*\bsmart\s+users[0-9]{2}\.csv\b'