Grepping a huge file (80GB) any way to speed it up?

前端 未结 5 1924
既然无缘
既然无缘 2020-11-29 15:52
 grep -i -A 5 -B 5 \'db_pd.Clients\'  eightygigsfile.sql

This has been running for an hour on a fairly powerful linux server which is otherwise not

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 15:52

    Some trivial improvement:

    • Remove the -i option, if you can, case insensitive is quite slow.

    • Replace the . by \.

      A single point is the regex symbol to match any character, which is also slow

提交回复
热议问题