pv: add a progress bar to any pipe

Monitor throughput, ETA and progress when copying files, writing images or streaming over SSH with pv.

LinuxpipeprogressthroughputHigh risk
Insert pv into a pipeline (pv FILE | dd of=...) to show a live progress bar; pass -s SIZE when pv can't know the total.

01Command

Command
$ pv big.iso | dd of=/dev/sdX bs=4M && tar -cf - dir | pv -s $(du -sb dir | cut -f1) | ssh host 'tar -xf -'

02What it does

Pipes give no feedback by default — a dd write to a USB stick or a tar-over-ssh transfer can sit silent for minutes. pv sits between the stages, measuring bytes flowing past and displaying percentage, elapsed time, current rate and ETA; when reading from a pipe it needs the expected size via -s (e.g. $(du -sb dir | cut -f1)) to compute a percentage. -L rate-limits transfers, and -n switches output to machine-readable percentages for scripts.

03Risk

RiskHigh risk
Requirementspv package
!Warning: Requires the pv package (not usually preinstalled); when dd'ing to a device, the target is overwritten irreversibly.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • pv(1) — Arch Linux manual
    Arch Linux · technical · 2026-09-17
    Evidence: Documents -p progress, -b bytes, -r rate, -s size and -L rate-limit options
  • pv(1) — Ubuntu manpage
    Canonical · technical · 2026-09-17
    Evidence: pv shows progress, elapsed time, throughput and ETA for data through a pipe; -s sets expected total size, -L limits rate

Last verified: 2026-09-17 · Category: Files & Folders