5 ms·
>pv < image.iso > /dev/sdb Huh? pv can cat stuff on it's own, and it will be able to make a progress bar based on the filesize pv image.img > /dev/sdb
by j3097736 10y ago
>pv < image.iso > /dev/sdb
Huh?
pv can cat stuff on it's own, and it will be able to make a progress bar based on the filesize
pv image.img > /dev/sdb
- stirner 10y agoOkay. I don't actually use pv, so I was just extrapolating from the original post. In any case, cat is definitely the wrong choice.
- amelius 10y agoSo I suppose that the command pv < image.iso > /dev/sdb would actually need to buffer the complete file, before commencing to write to the device (and showing the progress), which would defeat the whole idea of showing progress.
- farhaven 10y agoIt wouldn't. It just won't be able to predict a file size.
- heinrich5991 10y agoIf `pv` doesn't know the input size, it doesn't show it. In your case, it can determine that its stdin is a file by looking at the `/proc/self/fd/0` symlink: $ ls -l /proc/self/fd/0 < /tmp/x lr-x------ 1 user users 64 <date> /proc/self/fd/0 -> /tmp/x
- stirner 10y agoFrom what I can tell, bash uses 4K buffers for pipelines.