Print Lines in a File From a Specific Line Number Until the End of the File with sed

If you know that you want all of the lines in a given file from n to EOF the following is the sed command:

sed -n ‘3,$p’ some_file.txt

To print out lines 2 – 5 simply modify it to:

sed -n ‘2,5p’ some_file.txt

Leave a Reply