2 sed snippets
Snippets are tiny notes I've collected for easy reference.
Skip the first N lines in file
using tail
To skip the first line of a file (and start piping data at the second line):
tail -n +2 <FILENAME>
More generally:
tail -n +M <FILENAME>
where M
is the number of the first line you want to see (i.e., the number of lines to skip plus one).
using sed
To skip the first line of a file (and start piping data at the second line):
sed 1d <FILENAME>
More generally:
sed A,Bd <FILENAME>
when you want to exclude lines A
through B
from the output.
Snippets are tiny notes I've collected for easy reference.