how to extract lines from a file using their linenumber on unix

Posted by monkeyking on Stack Overflow See other posts from Stack Overflow or by monkeyking
Published on 2010-01-06T23:06:03Z Indexed on 2010/03/17 19:31 UTC
Read the original article Hit count: 213

Filed under:
|
|
|

Using sed or similar how would you extract lines from a file. Like if i wanted lines 1,5,1010,20503 from a file. How would you get these 4 lines.

What if I have a fairly large number of lines I need to extract. If I had a file with 100 lines each representing a linenr that I wanted to extract from another file. How would you do that.

thanks

© Stack Overflow or respective owner

Related posts about sed

Related posts about awk