grep -f alternative for huge files

前端 未结 4 1768
慢半拍i
慢半拍i 2021-02-04 09:41
grep -F -f file1  file2

file1 is 90 Mb (2.5 million lines, one word per line)

file2 is 45 Gb

That command doesn\'t actually produce a

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-04 10:20

    You can try ack. They are saying that it is faster than grep.

    You can try parallel :

    parallel --progress -a file1 'grep -F {} file2'
    

    Parallel has got many other useful switches to make computations faster.

提交回复
热议问题