Stochastic Nonsense

Put something smart here.

Bash Tricks: Drop the First Line of a File

I work with a bunch of data that often comes in text files. I regularly want to cut off the header / first line, but I thought that to use tail you had to know how many lines are in your file. It turns out that if you just use

$ tail -n +2 [file]

it will just skip the first line without forcing you to know how many lines there are.

earl $ cat a.csv
1
2
3
4
earl $ tail -n +2 a.csv
2
3
4

This is much more convenient for piping into awk or other commands downstream.