pv
- Pipe Viewer - is a terminal-based
tool for monitoring the progress of data through a pipeline. It can be
inserted into any normal pipeline between two processes to give a visual
indication of how quickly data is passing through, how long it has taken,
how near to completion it is, and an estimate of how long it will be until
completion.
Additional support is available for multiple instances working in tandem, to given a visual indicator of relative throughput in a complex pipeline:
Source for all systems and RPMs for RPM-based systems are available in the download area.
Comments, bug reports, and patches can be sent using the Contact Form.
Debian / Ubuntu: | Run "apt-get install pv " to get the latest packaged version from "unstable" / "testing". (Debian QA page here.) |
---|---|
CentOS / RHEL: | Set up my YUM repository or use RepoForge, then do "yum install pv ". |
Fedora: | Run "yum install pv "; the "extras " repository may be required. (Fedora package status here.) |
openSUSE Leap 15.3: | Run "sudo zypper install pv ". (Keith Guitar) |
Slackware: | Use this SlackBuild script. |
Cygwin: | Available as a package. (Christian Franke) |
FreeBSD: | Listed on FreshPorts. |
OpenBSD: | Listed under ports. |
Solaris: | Download binary packages from OpenCSW. |
OpenSolaris: | Includes pv version 1.1.4 in the "/dev " repository (as of build 119). Install with "pkg install SUNWpipe-viewer ". (Menno Lageman) |
AIX: | An RPM from Pawel Piatek is in the downloads section. |
SerenityOS: | Ported to SerenityOS. (Brian Gianforcaro) |
MacPorts: | Run "port install pv " to get the latest version. (Brandon Crawford) |
Mac HomeBrew: | Run "brew install pv " to get the latest version. (Justin Campbell) |
Exherbo: | Run "cave resolve -x app-misc/pv " to get the latest version. (Wulf C. Krueger) |
Gentoo: | Run "emerge sys-apps/pv " to get the latest version. (S. Lockwood-Childs; update from Peter Broadwell) |
IRIX Nekoware: | Available in the Nekoware "beta" repository. (Mark Round) |
Syabas PopcornHour: | Someone posted this port in a forum. |
Nix: | Run "nix-env -i pv ". (Erick Ochoa) |
Spack: | Run "spack install pv " to get the latest version. (Christoph Junghans) |
(7 Feb 2022) - Jacek Wielemborek writes:
pgrep -x gzip | xargs -n1 -I{} bash -c 'tmux split-window -l 1 pv -ptebar -d {}:3; tmux last-pane'
You can run this in a tmux session and it's going to display a progress bar for each currently running gzip decompression process. Quite often I run a massively parallel job and it's difficult to estimate ETA when the process is not uniform. This way I'm getting a lot of progress bars and I can get a better feel of the system's performance.
(29 Nov 2013) - Lee Yiu Chung writes:
I tried to compile pv under SmartOS (a fork from OpenSolaris), but I found a compiler error that struct stat
is redefined.
After some tracing I found that /usr/include/sys/stat.h
have BOTH "struct stat
" and "struct stat64
" defined, and the "define stat64 stat
" macro in autoconf/header.in
happily replacing stat64
to stat
, thus causing the compiler error.
As a result I have to modify autoconf/header.in
so that the offending macro is disabled in Solaris platform. Below is the diff file:
--- autoconf/header.in.orig 2013-08-01 03:39:15.000000000 +0800 +++ autoconf/header.in 2013-11-29 20:07:21.697885164 +0800 @@ -70,6 +70,7 @@ # define stat64 stat # define fstat64 fstat # endif +# elif defined(__sun) && defined(__SVR4) # else # define stat64 stat # define fstat64 fstat
Author notes: Large file support is not implemented very portably at the moment. I will try to fix it so it does not do things like redefining stat
in future, so this should be fixed in a future version. In the meantime please try the above patch that has been kindly supplied.
stddef.h
include to number.c
(Sam James)-B
, -A
, or -T
now switches on -C
implicitly (Johannes Gerer, André Stapf)--help
" translations (Richard Fonfara)/dev/sda
in the manual (Pranav Peshwe)-B 1024
" in the manual (Jan Venekamp)autoconf/scripts/index.sh
(Juan Picca)%llu
instead of %Lu
for better compatibility (Eric A. Borisch)-B
) being ignored (AndCycle, Ilya Basin, Antoine Beaupré)-d
" if process fd directory is unreadable, or if process disappears before we start the main loop (Jacek Wielemborek)lstat64
support when unavailable - separate patches supplied by Ganael Laplanche and Peter Korsgaard-D
" / "--delay-start
" to only show bar after N seconds (Damon Harper)--fineta
" / "-I
" to show ETA as time of day rather than time remaining - patch supplied by Erkki Seppälä (r147)--eta
/ -e
) so that days are given if the hours remaining are 24 or more (Jacek Wielemborek)--watchfd PID
, when PID exitsawk
bug in tests/016-numeric-timer
in decimal "," localesmake rpm
" and "make srpm
", extend "make release
" to sign releasessplice()
(Jan Seda)--watchfd
to look at block devices--watchfd PID:FD
work with --size N
--watchfd
- suggested by Jacek Wielemborek and "fdwatch"splice()
--buffer-percent
, suggested by Kim Krecht--last-written
, suggested by Kim Krecht--no-splice
--null
- patch supplied by Zing Shishak-lc128
) - with help from Pawel Piatek-c
fixes - with help from Pawel Piateksplice()
not using stdin - patch from Zev Weiss-R
" on Cygwinpv -h
" when configure
run with "--enable-debugging
"--skip-errors
commissioned by Jim Salter--stop-at-size
to stop after --size
bytes--format
parameters to be sent with --remote
--disable-ipc
--numeric
with --timer
and --bytes
--remote
--pidfile
option to save process ID to a file--numeric
with --timer
and --bytes
(Sami Liedes)--remote
to prevent accidental process kills--format
option (originally Vladimir Pal / Vladimir Ermakov)--disable-splice
configure script optionsplice()
if the write buffer is not empty (Thomas Rachel)splice()
handling which could in some circumstances corrupt data. Use 1.3.1 or newer.
splice(2)
where available (Debian bug #601683)LD=ld
from vars.mk
to fix cross-compilation (paintitgray/PV#1291)--average-rate
(Henry Gebhardt)--help
(Sebastian Kayser)pv_display
-O
" for non-GCC (Kjetil Torgrim Homme)DESTDIR
/ suffix (Sam Nelson, Daniel Pape)-L
, has non-numeric value (Boris Lohner)--remote
(-R
) to control an already-running process--line-mode
(-l
) to count lines instead of bytes-L
" to be less resource intensivemake uninstall
"/debian
directory at request of new Debian maintainer-l
" / "--license
" optioncat
" - just skip unreadable files, don't abort--buffer-size
(-B
) suggested by Mark Tomichpv /dev/zero | dd bs=1M count=1k
bug (reported by Gert Menke)key_t
incompatibility with Cygwin-i
) parameter parses numbers after decimal pointmsgfmt
is unavailable-L 1.23M
"make help
" now lists Makefile targetsuu_lock()
for terminal locking on FreeBSD-c
) reliability improved on systems with IPC--height
(-H
)srpm
" and "release
" Makefile targets-c
)DESTDIR
instead of RPM_BUILD_ROOT
for optional installation prefix--enable-debug
with --enable-debugging
and --enable-profiling
make index
" (only of interest to developers)pv /dev/hda1
" worksdoc/debian
dir (from Cédric Delfosse)make rpm
" and "make deb
" targets to build RPM and Debian packagesmake pv-static
" rule to build a statically linked version<=>
indicator no longer sticks at right hand edgemake check
")--rate-limit
), now done in 0.1sec chunks-i
) - max update interval now 10 minutesatoll()
--numeric
fcntl()
instead of flock()
for Solaris compatibilityEINTR
on select()
--no-progress
, etc optionsst_blksize
--wait
option to wait until transfer begins before showing progress--rate-limit
option to limit rate to a maximum throughput--quiet option
(no output at all) to be used with --rate-limit
FILE
]... arguments, like "cat
"
|