4 ms·
dd if=<input> | pv | dd of=<output> to get a count of bytes passing through, or pv <input> | dd of=<output> to get actual completion progress. For tarchi
by jagged-chisel 3y ago
dd if=<input> | pv | dd of=<output>
to get a count of bytes passing through, or
pv <input> | dd of=<output>
to get actual completion progress. For tarchives,
pv <tarchive> | tar x
Compression progress
pv <file> | bzip2 > <file>.bz2
- cellularmitosis 3y agoThis is also handy when using socat to pipe across a network. You can use pv on both ends, one looking at compressed and the other looking at uncompressed data, in order to observe the real-time compression ratio. tar c foo | pv | gzip | socat - tcp-listen:9999 socat tcp:bar:9999 - | pv > foo.tar.gz If pv shows that you aren’t saturating your network and are cpu limited, replace gzip with lzop. If vice versa, replace gzip with something more aggressive.
- upon_drumhead 3y agopv has a multi line mode so you can do tar c foo | pv -cN raw | gzip | pv -cN compressed | whatever else It’s handy to see multiple progress bars at once.
- formerly_proven 3y agozstd --adapt, used to have a few rough edges though.
- Self-Perfection 3y agopv also has little known ability to watch already running process in similar fashion to progress tool Try cp $BIGFILE ${BIGFILE}_1 & pv --watchfd $(pidof cp)
- anonymousiam 3y ago'pv' is great, but you need to have the foresight to use it in your command before you run it. 'progress' seems great for those cases where you didn't realize your job was going to take so long, and you don't want to start it all over again.
- jagged-chisel 3y agoIndeed. I created some aliases a few years ago to use pv in these cases. At least until I developed the habit of thinking about pv while composing the command.