Hacker News new | past | comments | ask | show | jobs | submit login

How does it know the progress / ETA?

I was under the assumption that pipes do not know how much total data is on its way?




If you give it a file, or specify the amount on the commandline it knows, otherwise it doesn't


Right. I usually use pv in place of 'cat' at the start of a long set of piped commands. Anywhere you could use 'cat' you can use pv. If I'm not mistaken, I think you can also use multiple 'pv' commands at a time too.


> If I'm not mistaken, I think you can also use multiple 'pv' commands at a time too.

I use multiple pv instances to track compression/decompression rates, and overall progress, for tarballs. Using the "-c" code for console codes keeps the instances from stomping over each other's output.


This is indeed visible in the example, only source has progress while bzcat and gzip only have flow.


You have to supply it the stream sizes if you want completion percentages, otherwise it displays rates only.

Example: https://gist.github.com/2783910




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: