1

I am using the zcat command and streaming a .tar.gz file through a piping operation. I want to skip the first line while zcat reads the file. How is it possible?

Cyrus
  • 84,225
  • 14
  • 89
  • 153
Pujan Paudel
  • 71
  • 1
  • 7

1 Answers1

2

You can pipe the output to tail, passing -n +2 to start at the second line:

zcat file | tail -n +2
Leonardo Dagnino
  • 2,914
  • 7
  • 28
  • Thanks ! Is there a way to do it directly without using tail intermediate ? – Pujan Paudel Jun 14 '20 at 03:49
  • 1
    I don't think there is, zcat's man page has no mention of anything like that. You'll need something else to do that, and tail is a really good candidate for this use case. – Leonardo Dagnino Jun 14 '20 at 04:26