如何在shell脚本中查找任何数字的文件扩展名

问题描述 投票:1回答:1

我想找到任何号码的文件扩展名,请你帮忙。

/大盘.104, /大盘.102, /大盘.101, /大盘.103

以下所需的输出

    `find <Path>/log -type f -name "dp.[0-9]+" `

此致,普拉文

shell
1个回答
0
投票

使用find的-regex选项:

find /path -type f -regex '.*/dp\.[0-9]+'
© www.soinside.com 2019 - 2024. All rights reserved.