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:
This software is distributed under the terms of the GNU General Public License version 3 or later.
To install pv
, follow these steps:
wget https://www.ivarch.com/programs/sources/pv-1.8.5.tar.gz tar xzf pv-1.8.5.tar.gz cd pv-1.8.5 sh ./configure make sudo make install
If you do not want to build it from source yourself, several operating
systems and Linux distributions carry pv
. See the
"Packages and ports" section below.
Comments, bug reports, and patches can be sent using the Issue tracker, or through the Contact Form.
Debian and Ubuntu: | Run "sudo apt-get install pv " to install the latest packaged version from "unstable" / "testing" (also see the Debian package tracker page). |
---|---|
Arch Linux: | Run "sudo pacman -S pv " to install the latest packaged version (also see the Arch Linux package information page). |
Cygwin: | Available as a package. (Christian Franke) |
Gentoo: | Run "emerge sys-apps/pv " to get the latest version (also see the Gentoo package information page). (S. Lockwood-Childs; update from Peter Broadwell) |
Slackware: | Use this SlackBuild script. |
openSUSE Leap 15.3: | Run "sudo zypper install pv ". (Keith Guitar) |
FreeBSD: | Listed on FreshPorts. |
OpenBSD: | Listed under ports. |
Fedora: | Run "yum install pv "; the "extras " repository may be required (also see the Fedora package information page). |
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) |
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.
--remote
” mechanism, using a temporary
file instead of SysV IPC, so it can work reliably even when there are
multiple PV instancessplint
” and “flawfinder
” (see
“make analyse
”) (#77)--discard
” option to discard input as if
writing to /dev/null (#42)--error-skip-block
” option to make
“--skip-errors
” skip whole blocks (#37)posix_fadvise()
like cat
(1)
does, to improve efficiency (#39)--enable-static
” option to
“configure
” for static builds (#75)--pidfile
”, write to a temporary file
and rename it into place, to improve securitycat
(1) by skipping them and moving on--line-mode
”
when all inputs are regular filesclock_gettime()
in ETA calculation to cope
with machine suspend/resume (#13)--width
” or “--height
” were
provided, do not change them when the window size changes (#36)--watchfd
”
moves backwards, show the rate using the correct prefix (#41)--cursor
” (#20), (#24)splint
” and “flawfinder
” (see
new target “make analyse
”)make check
”make check
” to ensure that
“make install
” installs everything expected--sync
”, call fsync()
instead of fdatasync()
on incapable systems (#73)configure
”--enable-static-nls
”--debug
” insteadmake analyse
” to run
“splint
” and “flawfinder
” on all source
files--help
” output is now
multi-byte locale awareindent
” rules to line length of 120
and reformatted code--sync
” option to flush cache to disk
after every write (related to #6, to improve
accuracy when writing to slow disks)--direct-io
” option to bypass cache -
implements #29
“Option to enable O_DIRECT” - requested by Romain Kang,
Jacek Wielemborekconfigure.in
as per suggestions in
newer “autoconf
” manualsheader.in
with one generated by
“autoheader
”, moving custom logic to a separate header file
“config-aux.h
”--version
” output to conform to GNU
standards$()
in all shell
scripts that did not come from elsewhere, as backticks are deprecated
and harder to readmake test
”make test
” mechanism to allow
certain tests to be skipped on platforms that cannot support themhead
” is not available, so that “make test
”
on stock OpenBSD 7.3 worksmake test
”sprintf()
and
snprintf()
with a new wrapper function
pv_snprintf()
to improve security and compatibilitystrcat()
with a wrapper
pv_strlcat()
to improve security and compatibilitywrite()
calls to the terminal with
a wrapper pv_write_retry()
for consistency--watchfd
” code--size
” option now accepts
“@filename
” to use the size of another file (pull request
#57 supplied by
Dave Beckett)--watchfd
” option is now available on OS
X (pull request #60 supplied by christoph-zededa)--bits
” option to show bit count instead
of byte count (adapted from pull request #63 supplied by Nick Black)--average-rate-window
” option, to set the
window over which the average rate is calculated, also used for ETA
(modified from pull request #65 supplied by lemonsqueeze)--watchfd
” option will now show relative
filenames, if they are under the current directory (pull request #66 supplied by ikasty)pv_in_foreground()
to behave as its
comment block says it should, when not on a terminal - corrects #19 “No output in Arch
Linux initcpio after 1.6.6”, #31 “No output written
from inside zsh <() construct”, #55 “pv Stopped
Working in the Background” (pull request #64 supplied by Michael Weiß)stat64()
on Apple Silicon”--force
” option so it will still output
progress when not in the same process group as the owner of the terminal
- corrects #23 “No
output with”-f
” when run in background after 1.6.6” and
helps to correct #31 “No output written
from inside zsh <() construct”--numeric
” mode with a “--size
” that was too
small - corrects #26
“Correct”-n
” behaviour when going past 100% of
“-s
” size”stddef.h
include to
number.c
(Sam James)