Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing first line from stdin and redirect to stdout

Tags:

unix

stdout

stdin

i need to redirect all of the stdout of a program except the first line into a file.

Is there a common unix program that removes lines from stdin and spits the rest out to stdout?

like image 273
Joe Van Dyk Avatar asked Oct 28 '08 00:10

Joe Van Dyk


2 Answers

tail -n +2 -f -

like image 174
tvanfosson Avatar answered Oct 05 '22 01:10

tvanfosson


Others have already mentioned "tail". sed will also work:

sed 1d

As will Awk:

awk 'NR > 1'
like image 23
Andru Luvisi Avatar answered Oct 05 '22 00:10

Andru Luvisi