LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to program in shell to get a part of a file by line number (https://www.linuxquestions.org/questions/linux-general-1/how-to-program-in-shell-to-get-a-part-of-a-file-by-line-number-502474/)

George2 11-17-2006 06:43 AM

how to program in shell to get a part of a file by line number
 
Hello everyone,


I am wondering how to program in shell to get a part of a file by indicated (input) line number, for example, get from line 100 to line 200 in a specific file.

What command(s) should I use?


thanks in advance,
George

matthewg42 11-17-2006 06:58 AM

sed -n '100,200p' inputfile

George2 11-19-2006 02:41 AM

Quote:

Originally Posted by matthewg42
sed -n '100,200p' inputfile


Thank you matthewg42! It works!


regards,
George


All times are GMT -5. The time now is 03:03 PM.