2026-06-03
You kicked off cp giant.iso /mnt/backup twenty minutes ago in another tmux pane. It's still going. Is it 5% done or 95%? You can't Ctrl-C and restart through pv — you'd lose the work. watch ls -la shows the destination file growing but tells you nothing about the source size. The grizzled answer is progress (formerly cv, the "Coreutils Viewer"), a tiny C program by Xfennec that attaches to any already-running process and reads its progress straight out of /proc.
Install it: apt install progress, brew install progress, or dnf install progress. Then point it at the running world:
# Show every recognized coreutils-ish job in flight
$ progress
[ 8409] cp /home/shaun/iso/ubuntu.iso
4.2 GiB / 5.7 GiB [=================>------] 73.6% 187 MiB/s eta 0:00:08
[12290] dd if=/dev/sda of=/mnt/img/sda.img
117 GiB / 953 GiB [===>---------------------] 12.3% 84 MiB/s eta 2:45:11
That's the killer feature — you didn't plan ahead. The cp was launched without pv, without --progress, without anything. progress walks /proc/$PID/fd/, finds the largest regular-file fd, reads /proc/$PID/fdinfo/$FD for the current seek position, and divides by the file's size. Pure user-space, no ptrace, no kernel module, no slowdown on the target.
Useful flags most people miss:
# Continuous monitor mode (like top) — refresh until you Ctrl-C
$ progress -m
# Wait for matching processes to appear, then track them
# Great for "the script will launch a dd somewhere, show me when it does"
$ progress -W 2 -c dd
# Pipe to another tool when the job finishes
$ progress -mp $(pgrep -f "tar.*backup") && notify-send "tar done"
# Quiet mode — just the bar, scriptable
$ progress -q -p 8409
73.6
# Track non-default commands (rsync, ffmpeg, openssl, etc.)
$ progress -a ffmpeg -a openssl
By default it watches a built-in list of ~25 commands (cp, mv, dd, tar, cat, gzip, gunzip, xz, zstd, rsync, shred, cpio, md5sum, sha*sum, …). Add yours with -a; ignore some with -i.
Why this beats the alternatives:
progress doesn't care; it joins the party late.dd for a progress bar is performing surgery to read a thermometer.One subtlety worth knowing: progress reports the largest open file descriptor by default, which is usually right but occasionally wrong (e.g. tar reading many sources). Use -W to disambiguate by command, or read /proc/$PID/io yourself for byte counters if you want true throughput including pipes.
It's a 1,500-line C program that does one thing the kernel has been telling you for free since 2.6 — and the only reason you needed it is that nobody wired the /proc/$PID/fdinfo pos field into the standard tools.
progress retrofits a progress bar onto any already-running cp/dd/tar/gzip by reading /proc/$PID/fdinfo — no replanning, no restart, no ptrace.
