Current version: 1.8.14 (7 September 2024) [src]
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.
- Source code: pv-1.8.14.tar.gz [signature]
- Manual for pv
- Git repository (at Codeberg)
- Issue tracker (at Codeberg)
To install pv
, follow these steps:
wget https://www.ivarch.com/programs/sources/ pv-1.8.14.tar.gz tar xzf pv-1.8.14.tar.gz cd pv-1.8.14 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.
Packages and ports
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) |
Notes
(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.
News
1.8.14 - 7 September 2024
1.8.13 - 18 August 2024
- feature: when using “
--size @FILE
”, FILE can be a block device, and its size will be used (pull request #94) supplied by alexanderperlis
1.8.12 - 18 July 2024
- fix: correct the detection of output block device size that was broken in 1.8.10 (#91)
- fix: do not treat a zero/interrupted write as an end of file (pull requests #92 and #93)
1.8.10 - 15 June 2024
- feature: new “
--output
” option to write to a file instead of standard output (pull request #90) supplied by xmort
1.8.9 - 21 April 2024
- feature: new “
--si
” option to display and interpret size suffixes in multiples of 1000 rather than 1024 (pull request #85) supplied by kevinruddy - fix: continue producing progress output when the output is blocking writes (#34, #86, #87)
- fix: honour the TMPDIR / TMP environment variables
again, rather than hard-coding “
/tmp
”, when using a terminal lock file (originally removed in 1.8.0) (#88) - i18n: corrections and missing strings added to French translations (pull request #83) supplied by Thomas Bertels
1.8.5 - 19 November 2023
- fix: corrected percentage formatting so it doesn’t jump from 2 to 3 characters wide at 100% (#80)
- fix: replaced “
--remote
” mechanism, using a temporary file instead of SysV IPC, so it can work reliably even when there are multiple PV instances - fix: corrected compilation failure when without IPC support
- security: addressed all issues highlighted by the software auditing
tools “
splint
” and “flawfinder
” (see “make analyse
”) (#77) - cleanup: compilation warnings fixed on non-IPC and MacOS systems
1.8.0 - 24 September 2023
Features
- feature: new “
--discard
” option to discard input as if writing to /dev/null (#42) - feature: new “
--error-skip-block
” option to make “--skip-errors
” skip whole blocks (#37) - feature: use
posix_fadvise()
likecat
(1) does, to improve efficiency (#39) - feature: new “
--enable-static
” option to “configure
” for static builds (#75)
Security
- security: with “
--pidfile
”, write to a temporary file and rename it into place, to improve security - security: keep self-contained copies of name and format string in PV internal state for memory safety
- security: ignore TMP / TMPDIR environment variables when using a terminal lock file
Fixes
- fix: only report errors about missing files when starting to
transfer from them, not while calculating size, and behave more like
cat
(1) by skipping them and moving on - fix: auto-calculate total line count with “
--line-mode
” when all inputs are regular files - fix: use
clock_gettime()
in ETA calculation to cope with machine suspend/resume (#13) - fix: if “
--width
” or “--height
” were provided, do not change them when the window size changes (#36) - fix: when a file descriptor position in “
--watchfd
” moves backwards, show the rate using the correct prefix (#41) - fix: rewrite terminal state save/restore so state is not
intermittently garbled on exit when using “
--cursor
” (#20), (#24)
Cleanups
- cleanup: addressed many potential issues highlighted by the software
auditing tools “
splint
” and “flawfinder
” (see new target “make analyse
”) - cleanup: switched the build system to GNU Automake
- cleanup: replaced the test harness with the one native to GNU Automake
- cleanup: added a test for terminal width detection to
“
make check
” - cleanup: added a test to “
make check
” to ensure that “make install
” installs everything expected - cleanup: replaced AC_HEADER_TIOCGWINSZ with AC_CHECK_HEADERS(sys/ioctl.h) for better MacOS compatibility (#74)
- cleanup: with “
--sync
”, callfsync()
instead offdatasync()
on incapable systems (#73) - cleanup: the manual is now a static file instead of needing to be
built with “
configure
”
Dropped items
- dropped: dropped support for “
--enable-static-nls
” - dropped: removed the Linux Software Map file, as the LSM project appears to be long dead
- dropped: will no longer publish to SourceForge as it has a chequered history and is unnecessary
- dropped: removed project from GitHub and moved to Codeberg - see “Give Up GitHub”
Other items
- licensing change from Artistic 2.0 to GPLv3+
1.7.24 - 30 July 2023
- fix: correct terminal size detection, broken in 1.7.17 by the configuration script rewrite (#72)
- security: removed DEBUG environment variable in debug mode,
added “
--debug
” instead - cleanup: added “
make analyse
” to run “splint
” and “flawfinder
” on all source files - cleanup: corrected detection of boolean capability
- cleanup: word wrapping of “
--help
” output is now multi-byte locale aware - cleanup: adjusted “
indent
” rules to line length of 120 and reformatted code
1.7.18 - 28 July 2023
- fix: language file installation had been broken by the configuration script rewrite
1.7.17 - 27 July 2023
- feature: new “
--sync
” option to flush cache to disk after every write (related to #6, to improve accuracy when writing to slow disks) - feature: new “
--direct-io
” option to bypass cache - implements #29 “Option to enable O_DIRECT” - requested by Romain Kang, Jacek Wielemborek - fix: correct byte prefix size to 2 spaces in rate display, so progress display size remains constant at low transfer rates
- cleanup: rewrote
configure.in
as per suggestions in newer “autoconf
” manuals - cleanup: replaced
header.in
with one generated by “autoheader
”, moving custom logic to a separate header file “config-aux.h
” - cleanup: added copyright notice to all source files as per GNU standards
- cleanup: changed “
--version
” output to conform to GNU standards - cleanup: replaced backticks with
$()
in all shell scripts that did not come from elsewhere, as backticks are deprecated and harder to read - cleanup: improved the output formatting of
“
make test
” - cleanup: extended the “
make test
” mechanism to allow certain tests to be skipped on platforms that cannot support them - cleanup: skip the “pipe” test (for SIGPIPE) if GNU
“
head
” is not available, so that “make test
” on stock OpenBSD 7.3 works - cleanup: added a lot more tests to “
make test
” - cleanup: replace all calls to
sprintf()
andsnprintf()
with a new wrapper functionpv_snprintf()
to improve security and compatibility - cleanup: replace all calls to
strcat()
with a wrapperpv_strlcat()
to improve security and compatibility - cleanup: replace all
write()
calls to the terminal with a wrapperpv_write_retry()
for consistency - cleanup: tidy up and fix compilation warning in
“
--watchfd
” code - cleanup: rewrote all local shell scripts to pass analysis by ShellCheck
1.7.0 - 17 July 2023
- dropped: support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries
- feature: the “
--size
” option now accepts “@filename
” to use the size of another file (pull request #57 supplied by Dave Beckett) - feature: the “
--watchfd
” option is now available on OS X (pull request #60 supplied by christoph-zededa) - feature: new “
--bits
” option to show bit count instead of byte count (adapted from pull request #63 supplied by Nick Black) - feature: new “
--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) - feature: the “
--watchfd
” option will now show relative filenames, if they are under the current directory (pull request #66 supplied by ikasty) - fix: correction to
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ß) - fix: workaround for OS X 11 behaviour in configure script regarding stat64 at compile time (pull request #57 supplied by Dave Beckett)
- fix: workaround for macOS equivalence of stat to stat64 - patches
from Filippo Valsorda and
Demitri Muna, correcting #33 “Fix compilation
problems due to
stat64()
on Apple Silicon” - fix: add burst rate limit to transfer, so rate limits are not broken by bursty traffic (pull request #62 supplied by Volodymyr Bychkovyak)
- fix: corrected “
--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” - fix: corrected elapsed time display to show as D:HH:MM:SS after 1 day, like the ETA does - corrects #16 “Show days in same format in ETA as in elapsed time”
- fix: corrected bug where percentages went down after 100% when in
“
--numeric
” mode with a “--size
” that was too small - corrects #26 “Correct”-n
” behaviour when going past 100% of “-s
” size” - i18n: recoded Polish translation file to UTF-8
- i18n: removed inaccurate fuzzy translation matches
- docs: moved all open issues into GitHub and updated the TODO list
- docs: renamed README to README.md and altered it to Markdown format
- docs: moved contributors from the README to docs/ACKNOWLEDGEMENTS.md
- docs: moved TODO to TODO.md and altered it to Markdown format
- docs: moved NEWS to NEWS.md, converted it to UTF-8, and altered it to Markdown format
1.6.20 - 12 September 2021
- fix: add missing
stddef.h
include tonumber.c
(Sam James)