Pipe Viewer
June 16th, 2008
Today I found a really nice program for long-running console commands: pv, aka “Pipe Viewer“.
If youâve ever strung together a long command with pipes, run it, questioned why itâs taking so long, maybe open another terminal to run top⦠pv is the answer to that question.
Itâs very similar to tee, except instead of sending a copy of the data to a file, it displays one or more progress meters on the screen so you can see the flow of data through your piped commands.
It can be easily installed via apt or downloaded on the official website as RPM.
The usage is very simple. If you like to compress a file and show the progress visually you can do it this way:
pv big.iso | gzip > big.iso.gz 50.3MB 0:00:05 [11.6MB/s] [=====> ] 33% ETA 0:00:09
In the manual you can find some more, also very complex examples such as this more complicated example using numeric output to feed into the dialog program for a full-screen progress display:
pv file | nc -w 1 somewhere.com 3000 (tar cf - . \ | pv -n -s âdu -sb . | awk â{print }ââ \ | gzip -9 > out.tgz) 2>&1 \ | dialog --gauge âProgressâ 7 70
You should mention that the program is aborted if a numeric option, such as -L, has a non-numeric value.





