I am trying to get data after the n:th line number.
I have a file with 1500 lines, but I want to print the data after 750 lines.
I tried head
and tail
, but couldn't get exactly what I wanted.
I am trying to get data after the n:th line number.
I have a file with 1500 lines, but I want to print the data after 750 lines.
I tried head
and tail
, but couldn't get exactly what I wanted.
You can use tail
tail -n +751 file
from man tail
:
use
-n +NUM
to output starting with line NUM
Alternative using sed
:
sed '1,750d' file
(d
elete everything from line 1 to 750)
The awk
command can be used with operators to specify the number record. In this case greater than (after) record 750.
awk 'NR>750' input_file_name
The awk
command, or its distribution-specific counterparts like mawk
in ubuntu, are usually available even in the most lean, base distrubitions. An awk program is a sequence of patterns and corresponding actions. The awk program 'NR>750' simply returns all records after line number 750.
Sourced from: https://stackoverflow.com/a/25678925/5387389
NR>750
as OP wants to print after line 750. Maybe that is why the downvote. However, that should be a comment rather than a downvote.
– pLumo
Sep 20 '21 at 18:47
lp
or equivalent print spooler command. This does not change the what question is asking for. – Kusalananda Sep 20 '21 at 18:34