bash - shuffle a file that is too large to fit in memory

前端 未结 6 1096
梦毁少年i
梦毁少年i 2021-01-01 20:29

I\'ve got a file that\'s too large to fit in memory. shuf seems to run in RAM, and sort -R doesn\'t shuffle (identical lines end up next to each ot

6条回答
  •  佛祖请我去吃肉
    2021-01-01 20:57

    Have a look at https://github.com/alexandres/terashuf . From page:

    terashuf implements a quasi-shuffle algorithm for shuffling multi-terabyte text files using limited memory

提交回复
热议问题