What unix shell command can I use to get lines x (e.g. 10) to y (e.g. to 15) from a file. grep
doesn't seem to help and except doing a for loop I can't think of anything else.
You can use sed
:
sed -n '5,10p' filename
to print lines from 5 to 10.
head y, tail y-x
head -n 15 filename | tail -n 5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With