提取 filename.ext* 的语法,但不提取 filename.ext*.*

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

我的意思是我到目前为止还无法弄清楚这个问题。

file1.ext1
file7.ext2
fileQ.ext3
# should be accepted
file1.ext1.bak
# should not be accepted

@tim roberts - 几乎已经完成,除了 file1.ext11 或 file1.extAB 不起作用 - 但让我尝试一些事情,t/u!

shell unix ksh
1个回答
0
投票

如果需要匹配

.ext
后面的字母和数字,可以尝试:

ls -lh file*.ext+([0-9a-zA-Z])
© www.soinside.com 2019 - 2024. All rights reserved.