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 +NUMto output starting with line NUM
Alternative using sed:
sed '1,750d' file
(delete 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