3 ms·
Unless pv has gotten way more magical since the last time I used it, you also need to tell it how many bytes to expect if you want a progress bar. If it doesn'
by philsnow 14y ago
Unless pv has gotten way more magical since the last time I used it, you also need to tell it how many bytes to expect if you want a progress bar.
If it doesn't know how many bytes there will be, it just gives you a "throbber" (which is better than nothing, though).
- dspillett 14y agoIt depends how you call it. cat file | pv | nc ... and gzip < file | pv | nc ... and so forth will result in a throbber as it can't query the pipe for a length. If you demoggify the first example to: pv file | nc ... you get a progress bar on the sending end without manually specifying a size. Even without a proper % progress bar, the display can be useful as you can at least see the total sent so far (so if you know the approximate final size you can judge completeness in your head) and the current rate (so you can see it is progressing as expected (so you get some indication of a problem such as an unexpectedly slow network connection, other than it taking too long)).