By Alvin Alexander. Last updated: June 4, 2016
Although I've written my own Perl program to extract lines from the middle of a file, I was just reminded that this can be done with the Linux sed
command.
Here's a simple sed
command example. Supposed you want to print lines 500 through 600 from a file named reallyBigFile.txt
. Just issue this command and you'll get what you want:
sed -n '500,600p' reallyBigFile.txt