grep -f maximum number of patterns?

前端 未结 5 1239
悲&欢浪女
悲&欢浪女 2020-12-18 04:53

I\'d like to use grep on a text file with -f to match a long list (10,000) of patterns. Turns out that grep doesn\'t like this (who, knew?). After a day, it didn\'t produce

5条回答
  •  既然无缘
    2020-12-18 05:25

    From comments, it appears that the patterns you are matching are fixed strings. If that is the case, you should definitely use -F. That will increase the speed of the matching considerably. (Using 479,000 strings to match on an input file with 3 lines using -F takes under 1.5 seconds on a moderately powered machine. Not using -F, that same machine is not yet finished after several minutes.)

提交回复
热议问题