by Jeremy Canfield | Updated December 8th, 2017
Let's say file.txt contains the following text.
~]# cat file.txt Hello World How are you today?
The sed command can be used to print certain lines of the file. In this example, lines 1 through 3 and line 6 are printed.
~]# cat file.txt | sed -n -e 1,3p -e 6p Hello World How today?