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

前端 未结 5 1925
既然无缘
既然无缘 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 16:15

    Two lines of attack:

    • are you sure, you need the -i, or do you habe a possibility to get rid of it?
    • Do you have more cores to play with? grep is single-threaded, so you might want to start more of them at different offsets.

提交回复
热议问题