Skip to content

Instantly share code, notes, and snippets.

@ejhayes
Created July 15, 2014 19:18
Show Gist options
  • Save ejhayes/3dc6efbd5b67259df829 to your computer and use it in GitHub Desktop.
Save ejhayes/3dc6efbd5b67259df829 to your computer and use it in GitHub Desktop.
Way to count lines in a big file that is compressed without having to decompress. Includes ability to monitor counting progress
zcat $FILENAME | pv -cN extracting -s $(gzip -l $FILENAME | awk '{ print $2 }' | tail -1) | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment