Linux provides at least two handy command-line tools to monitor data transfer progress: bar
and pv
.
Both display a one-line progress bar with speed, elapsed or estimated time, and provide customizable formatting.
Examples with bar
:
If data size is unknown:
dd if=/dev/zero | bar | dd of=/dev/null
2.3GB at 581.8MB/s elapsed: 0:00:04
If data size is known:
dd if=/dev/zero iflag=count_bytes count=10G | bar --size 10G | dd of=/dev/null
1.2GB at 592.8MB/s eta: 0:00:15 11% [===== ]
Examples with pv
:
dd if=/dev/zero iflag=count_bytes count=10G | pv | dd of=/dev/null
2.59GiB 0:00:06 [ 397MiB/s] [ <=> ]
dd if=/dev/zero iflag=count_bytes count=10G | pv --size=10G | dd of=/dev/null
2.59GiB 0:00:06 [ 467MiB/s] [========> ] 25% ETA 0:00:17
pv
can also count lines instead of bytes, useful for monitoring log or message rates:
sudo dmesg -w | pv --line --rate > /dev/null
[ 496k/s]
On a side note, dd
can also report progress at runtime, when status=progress
is specified.
dd if=/dev/zero iflag=count_bytes count=10G of=/dev/null status=progress
2791971840 bytes (2.8 GB, 2.6 GiB) copied, 3 s, 931 MB/s