Using sed to extract line ranges from a text file

Using the Linux sed command to extract line ranges from very large text files.

I often find myself working with very large text files, which are impractical to open in an editor. If you need to extract a line-range section from a file, you can use sed:

$ sed -n 100,200p really_big_file.log

...where 100 is the starting line, and 200 is the end.

John Collins

I have been writing about web technology and software development since 2001. I am the developer of the Alpha Framework for PHP, and the personal productivity app. I love open source, technology, and economics.