Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been trying to split a large file (some GB) into pieces, I need to chunk the file by linenumber (say, containings about 1M lines each).

How could I do? csplit does not work, goes out of memory. Below, an example of the content:

690451  World_War_II    Allies_of_World_War_II
690451  World_War_II    Axis_powers_of_World_War_II
share|improve this question
up vote 2 down vote accepted

Use the command line tool split with the -l (lines) option.

split -l 1000000
share|improve this answer
Ahhhh Thank you so much Daniel, it was so simple!!! Ich danke lhenen :D – user305883 Feb 11 '12 at 9:25
You're welcome. Please remember to click the checkmark next to my answer to mark this question answered. – Daniel Beck Feb 11 '12 at 9:27
thank you, did it. cannot vote yet :) – user305883 Feb 11 '12 at 9:29
Thanks. Although I have to add to my answer, it ignores any context. But except for the title, you didn't mention that again, so I wasn't sure how to interpret that... – Daniel Beck Feb 11 '12 at 9:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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