I have one .txt file which has more than 1 million record inside. (rownum from 1 to 1 million) I need to divide this file into two 500k files in linux. (file1 = rownum from 1 to 500k and file2 = rownum from 500k to 1 million).

How can I do it?


1 Answer 1


You are looking for the program split.

split -l 500000 file prefix

Not the answer you're looking for? Browse other questions tagged or ask your own question.