Current version: 1.9.25 (22 December 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.9.25.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.9.25.tar.gz tar xzf pv-1.9.25.tar.gz cd pv-1.9.25 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.9.25 - 22 December 2024
- fix: test failure of –watchfd on macOS corrected (#124)
1.9.24 - 19 December 2024
- feature: new –format sequences for graphical progress bars - “%{bar-block}”, “%{bar-granular}”, and “%{bar-shaded}” (#15)
- feature: new –format sequence “%{sgr:colour,…}” to use ECMA-48 Select Graphic Rendition codes to add colours
- feature: new –bar-style option to change the default bar style (#15)
- feature: allow decimal values such as “1.5G” with “–size”, “–rate-limit”, “–buffer-size”, and “error-skip-block” (#35)
- cleanup: improve progress bar granularity on wide displays by internally tracking the transfer percentage as a decimal number
- cleanup: correct detection of –remote usability on GNU Hurd
- cleanup: reduce likelihood of race conditions in tests when running on slow systems
- cleanup: reduce memory footprint
- docs: simplified the synopsis section of the manual
1.9.15 - 8 December 2024
- feature: new –format sequence “%nL”, showing the most recent line written (#121)
- feature: each –format sequence now has a more readable equivalent name, for example “%r” can be written as “%{rate}”
- feature: new –format sequences “%{progress-bar-only}” and “%{progress-amount-only}”
- fix: allow –format to include “%nA” more than once, with different “n” values (#122)
- fix: allow –format to include “%p” more than once, with optional width prefix
- fix: calculate width correctly when wide characters are in –format strings
- fix: add configure script fallback for –remote check when cross-compiling (#120)
- fix: allow extra-display to be changed by –remote (#123)
- cleanup: refactored display formatters into separate functions
- cleanup: improve format parser handling of dangling or invalid “%” sequences
1.9.7 - 2 December 2024
- feature: new –extra-display option to update window and process titles (#3, #4)
- fix: correct failure to report file positions in –watchfd (#118)
- i18n: Russian translations added
- cleanup: tests added for –watchfd (#10)
- cleanup: worked around file descriptor leak false positives in valgrind 3.23 (#97)
- cleanup: cleared all shellcheck warnings in the test scripts
- cleanup: check at compile-time whether –remote is going to be usable (#119)
1.9.0 - 15 October 2024
- feature: new –store-and-forward option to read input to a file first, then write it to the output (#100)
- feature: new –stats option to show
transfer stats at the end, like “
ping
” (#49) - feature: –rate can now be used with –numeric (#17)
- feature: –gauge with –progress to show rate gauge when size is unknown (#46)
- i18n: comprehensive German translations update
- i18n: comprehensive Polish translations update
- i18n: complete Turkish translations added
- i18n: complete Czech translations added
- i18n: updates to French translations
- fix: resume stopped pipelines when running in the background (part of #56)
- fix: inspect the output pipe buffer to give a more accurate progress indicator of how much the next command has consumed
- fix: prefix completion time (–fineta) with FIN rather than ETA (#43)
- fix: surround average rate (–average-rate) with brackets rather than square brackets
- fix: correct a memory leak in –watchfd PID
- fix: make –direct-io work correctly with –output instead of assuming stdout
- fix: call
posix_fadvise()
on every input, not just the first one - fix: write UTC timestamps in debugging mode to avoid lockups in signal handlers
- security: added a signed MANIFEST file to releases
- cleanup: removed TODO.md, since it’s just an outdated copy of the issue tracker
- cleanup: re-ordered structure members to reduce padding
- cleanup: improved readability of SIGTTOU handling code
- cleanup: refactored to separate display, transfer, and calculation more cleanly
- cleanup: instead of moving stderr when backgrounded, set a suspend-output flag
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+