Question: I have a *very* large compressed file I'm processing using `grep`. 

```
zcat blah.gz | grep -e pattern | gzip -c > pattern.gz

```

I'd like to print something to `stderr` for every million or so input lines processed, just to keep track of progress. Any ideas?

Answer: 
Try [`pv`](http://www.ivarch.com/programs/pv.shtml). It defaults to bytes, but there's a switch to make it lines.
Replace the grep with:

```

perl -ne 'print if /pattern/; print STDERR "." if $. % 1000000 == 0'

```