How to file split at a line number

Posted by superspace on Stack Overflow See other posts from Stack Overflow or by superspace
Published on 2010-06-18T02:55:29Z Indexed on 2010/06/18 3:03 UTC
Read the original article Hit count: 287

Filed under:
|
|

I want to split a 400k line long log file from a particular line number.

For this question, lets make this an arbitrary number 300k.

Is there a linux function that allows me to do this?

I know split lets me split the file in equal parts either by size or line numbers but that's not what I want. I want to the first 300k in one file and the last 100k in the second file.

Any help would be appreciated. Thanks!

© Stack Overflow or respective owner

Related posts about linux

Related posts about split