我认为这可以解决问题:
find src -type f -regextype egrep -regex '.*(?<!\.d)\.ts'
但它似乎没有匹配任何东西。
我认为这应该可行,但我猜这种“egrep”风格不支持负反向引用,除非我没有正确地逃避某些东西。
以供参考,
% find src -type f
src/code-frame.d.ts # <-- I want to filter this out
src/foo.ts
src/index.ts
是否有另一种快速方法可以.d.ts
从我的搜索结果中过滤掉文件?
% find --version
find (GNU findutils) 4.7.0-git