Search code examples
bashgunzipzcat

zcat skip streaming first line while reading from a compressed file


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?


Solution

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

    zcat file | tail -n +2