How to Monitor Data Transfer Progress in Linux Terminal Using pv (Pipe Viewer)

When executing long-running command-line operations in Linux—such as creating raw block-level disk images with dd, compressing multi-gigabyte database dumps with gzip, or streaming archive payloads across local sockets using netcat—standard shell pipelines operate silently. Because native utilities do not provide progress indicators by default, systems administrators are often left guessing whether an I/O process is progressing normally, encountering storage bottlenecks, or hanging indefinitely.

The pv (Pipe Viewer) terminal utility solves this visibility limitation. Designed to sit between pipeline commands, pv measures data flowing through standard input and standard output, displaying a visual progress bar, real-time throughput velocity, total elapsed duration, and estimated time of arrival (ETA) without corrupting binary data streams.

Installing the pv Utility on Linux Distributions

The pv utility is available in the official package repositories of all major Linux distributions:

  1. On Ubuntu, Debian, and Linux Mint:
sudo apt update && sudo apt install -y pv
  1. On Fedora, RHEL, and Rocky Linux:
sudo dnf install -y pv
  1. On Arch Linux and Manjaro:
sudo pacman -S pv

Monitoring File Transfers and Archive Compression

To view progress while compressing a large file or writing raw images:

  1. Insert pv between source files and compression algorithms:
pv access.log | gzip > access.log.gz

The terminal immediately displays an interactive progress bar:

 245MB 0:00:14 [17.5MB/s] [========================>             ] 64% ETA 0:00:08
  1. When creating a compressed tar archive of an entire directory:
tar -cf - /var/www/html | pv -s $(du -sb /var/www/html | awk '{print $1}') | gzip > backup.tar.gz

Supplying the -s (size) parameter provides pv with the total expected byte count, allowing it to calculate percentage completion and ETA accurately.

Monitoring Disk Cloning with dd and Limiting Transfer Rates

Raw block device cloning frequently locks storage buses. You can combine pv with rate-limiting flags to prevent storage starvation:

  1. Monitor block transfers between raw drives:
sudo dd if=/dev/sda | pv | sudo dd of=/dev/sdb bs=4M
  1. Throttling throughput to prevent network or disk saturation using the -L (rate limit) flag:
pv -L 20M /path/to/massive.iso | nc 192.168.1.50 9000

This restricts the transmission rate to a maximum of 20 megabytes per second, safeguarding shared bandwidth for critical services.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.