Sounds like a job for sed
:
sed -n '8,12p' yourfile
…will send lines 8 through 12 of yourfile
to standard out.
If you want to prepend the line number, you may wish to use cat -n
first:
cat -n yourfile | sed -n '8,12p'
Sounds like a job for sed
:
sed -n '8,12p' yourfile
…will send lines 8 through 12 of yourfile
to standard out.
If you want to prepend the line number, you may wish to use cat -n
first:
cat -n yourfile | sed -n '8,12p'