我的意思是我到目前为止还无法弄清楚这个问题。
file1.ext1
file7.ext2
fileQ.ext3
# should be accepted
file1.ext1.bak
# should not be accepted
@tim roberts - 几乎已经完成,除了 file1.ext11 或 file1.extAB 不起作用 - 但让我尝试一些事情,t/u!
如果需要匹配
.ext
后面的字母和数字,可以尝试:
ls -lh file*.ext+([0-9a-zA-Z])