Split text file into smaller multiple text file using command line

后端 未结 9 2146
借酒劲吻你
借酒劲吻你 2020-12-22 18:03

I have multiple text file with about 100,000 lines and I want to split them into smaller text files of 5000 lines each.

I used:

split -l 5000 filena         


        
9条回答
  •  不知归路
    2020-12-22 18:28

    Syntax looks like:

    $ split [OPTION] [INPUT [PREFIX]] 
    

    where prefix is PREFIXaa, PREFIXab, ...

    Just use proper one and youre done or just use mv for renameing. I think $ mv * *.txt should work but test it first on smaller scale.

    :)

提交回复
热议问题