7

I have a zipped text file a.zip I want to read the first 10 lines of it. Is it possible to do that without unzipping the whole file?

1 Answers1

11

This simple pipe-script works for me:

zcat a.zip | head -n 10

Here:

  • zcat a.zip - unpacks zip-archive and sends its contents to standard output
  • | pipes zcat output to head input
  • head -n 10 - shows first 10 lines from its standard input
N0rbert
  • 103,263