How to split a large text file into smaller files with equal number of lines?

前端 未结 10 738
一整个雨季
一整个雨季 2020-11-22 16:42

I\'ve got a large (by number of lines) plain text file that I\'d like to split into smaller files, also by number of lines. So if my file has around 2M lines, I\'d like to

10条回答
  •  醉话见心
    2020-11-22 17:17

    Use:

    sed -n '1,100p' filename > output.txt
    

    Here, 1 and 100 are the line numbers which you will capture in output.txt.

提交回复
热议问题