【发布时间】:2010-03-23 13:19:07
【问题描述】:
我正在尝试从文件搜索中排除某个字符串。
假设我有一个文件列表:file_Michael.txt、file_Thomas.txt、file_Anne.txt。
我希望能够写出类似
的东西ls *<and not Thomas>.txt
给我 file_Michael.txt 和 file_Anne.txt,但不给我 file_Thomas.txt。
反过来很容易:
ls *Thomas.txt
使用单个字符也很容易:
ls *[^s].txt
但是如何用字符串来做呢?
塞巴斯蒂安
【问题讨论】: