I am trying to do a record count on a 7.6 GB gzip file. I found few approaches using the zcat command.$ zcat T.csv.gz | wc -l423668947This works but it takes too much time (more than 10 minutes to get the count). I tried a few more approaches like$ sed -n '$=' T.csv.gz28173811$ perl -lne 'END { print $. }' < T.csv.gz28173811$ awk 'END {print NR}' T.csv.gz28173811All three of these commands are executing pretty fast but giving an incorrect count of 28173811.How can I perform a record count in a minimal amount of time?
Fastest and most efficient way to get number of records (lines) in a gzip-compressed file
shell;gzip