PV package:

[Top] | [Contents] | [Index] | [ ? ]

# PV package

This edition of the PV manual, last updated 29 June 2004, documents `pv` version 0.9.6.

> 1. Overview |  | Overview of `pv`.
> 2. Invocation |  | Invoking `pv`.

> Concept Index |  | Index of concepts.

> -- The Detailed Node Listing ---

> 2.1 Display switches |  | Options to change which information is shown.
> 2.2 Output modifiers |  | Options altering the way this information is given.
> 2.3 General options |  | Everything that's left over.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# 1. Overview

This is the documentation for `pv`, 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.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# 2. Invocation

Summary: `pv [OPTION] [FILE]...`

To use `pv`, insert it in a pipeline between two processes, with the appropriate options. Its standard input will be passed through to its standard output and progress will be shown on standard error.

`pv` will copy each supplied FILE in turn to standard output (`-` means standard input), or if no FILEs are specified just standard input is copied. This is the same behaviour as `cat`.

A simple example to watch how quickly a file is transferred using `nc`:

    pv file | nc -w 1 somewhere.com 3000

A similar example, transferring a file from another process and passing the expected size to `pv`:

    cat file | pv -s 12345 | nc -w 1 somewhere.com 3000

A more complicated example using numeric output to feed into the `dialog` program for a full-screen progress display:

    (tar cf - . \
     | pv -n -s `du -sb . | awk '{print $1}'` \
     | gzip -9 > out.tgz) 2>&1 \
    | dialog --gauge 'Progress' 7 70

Frequent use of this third form is not recommended as it may cause the programmer to overheat.

`pv` takes many options, which are divided into display switches, output modifiers, and general options.

> 2.1 Display switches |  | Options to change which information is shown.
> 2.2 Output modifiers |  | Options altering the way this information is given.
> 2.3 General options |  | Everything that's left over.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.1 Display switches

If no display switches are specified, `pv` behaves as if `-p`, `-t`, `-e`, `-r`, and `-b` had been given (i.e. everything is switched on). Otherwise, only those display types that are explicitly switched on will be shown.

`-p`
`--progress`
  Turn the progress bar on. If standard input is not a file and no size was given (with the `-s` modifier), the progress bar cannot indicate how close to completion the transfer is, so it will just move left and right to indicate that data is moving.

`-t`
`--timer`
  Turn the timer on. This will display the total elapsed time that `pv` has been running for.

`-e`
`--eta`
  Turn the ETA timer on. This will attempt to guess, based on previous transfer rates and the total data size, how long it will be before completion. This option will have no effect if the total data size cannot be determined.

`-r`
`--rate`
  Turn the rate counter on. This will display the current rate of data transfer.

`-b`
`--bytes`
  Turn the total byte counter on. This will display the total amount of data transferred so far.

`-n`
`--numeric`
  Numeric output. Instead of giving a visual indication of progress, `pv` will give an integer percentage, one per line, on standard error, suitable for piping (via convoluted redirection) into the `dialog` program. Note that `-f` is not required if `-n` is being used.

`-q`
`--quiet`
  No output. Useful if the `-L` option is being used on its own to just limit the transfer rate of a pipe.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.2 Output modifiers

`-L RATE`
`--rate-limit RATE`
  Limit the transfer to a maximum of RATE bytes per second. A suffix of "k", "m", "g", or "t" can be added to denote kilobytes (*1024), megabytes, and so on.

`-W`
`--wait`
  Wait until the first byte has been transferred before showing any progress information or calculating any ETAs. Useful if the program you are piping to or from requires extra information before it starts, eg piping data into `gpg` or `mcrypt` which require a passphrase before data can be processed.

`-s SIZE`
`--size SIZE`
  Assume the total amount of data to be transferred is SIZE bytes when calculating percentages and ETAs. The same suffixes of "k", "m" etc can be used as with `-L`.

`-i SEC`
`--interval SEC`
  Wait SEC seconds between updates. The default is to update every second. Note that this can be a decimal such as 0.1.

`-w WIDTH`
`--width WIDTH`
  Assume the terminal is WIDTH characters wide, instead of trying to work it out (or assuming 80 if it cannot be guessed).

`-H HEIGHT`
`--height HEIGHT`
  Assume the terminal is HEIGHT rows high, instead of trying to work it out (or assuming 25 if it cannot be guessed).

`-N NAME`
`--name NAME`
  Prefix the output information with NAME. Useful in conjunction with `-c` if you have a complicated pipeline and you want to be able to tell different parts of it apart.

`-f`
`--force`
  Force output. Normally, `pv` will not output any visual display if standard error is not a terminal. This option forces it to do so.

`-c`
`--cursor`
  Use cursor positioning escape sequences instead of just using carriage returns. This is useful in conjunction with `-N` (name) if you are using multiple `pv` invocations in a single, long, pipeline.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.3 General options

`-h`
`--help`
  Print a usage message on standard output and exit successfully.

`-l`
`--license`
  Print details of the program's license on standard output and exit successfully.

`-V`
`--version`
  Print version information on standard output and exit successfully.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# Concept Index

Jump to: | B C D E F H I L N O P Q R S T U W

| Index Entry | Section
B |  |
| Bytes transferred | 2.1 Display switches
C |  |
| Completion time | 2.1 Display switches
| Cursor positioning | 2.2 Output modifiers
D |  |
| Data size | 2.2 Output modifiers
| Dialog, output to | 2.1 Display switches
E |  |
| Elapsed time | 2.1 Display switches
| ETA | 2.1 Display switches
| Example, using dialog | 2. Invocation
| Example, using nc | 2. Invocation
F |  |
| Force terminal output | 2.2 Output modifiers
H |  |
| Height | 2.2 Output modifiers
I |  |
| Interval | 2.2 Output modifiers
L |  |
| Limiting transfer rate | 2.2 Output modifiers
N |  |
| Name | 2.2 Output modifiers
| No output | 2.1 Display switches
| Numeric output | 2.1 Display switches
O |  |
| Output height | 2.2 Output modifiers
| Output width | 2.2 Output modifiers
P |  |
| Percentage only output | 2.1 Display switches
| Prefix | 2.2 Output modifiers
| Progress bar | 2.1 Display switches
Q |  |
| Quiet (no output) | 2.1 Display switches
R |  |
| Rate | 2.1 Display switches
| Rate limiting | 2.2 Output modifiers
S |  |
| Silent (no output) | 2.1 Display switches
| Size | 2.2 Output modifiers
T |  |
| Terminal columns | 2.2 Output modifiers
| Terminal height | 2.2 Output modifiers
| Terminal rows | 2.2 Output modifiers
| Terminal width | 2.2 Output modifiers
| Time, elapsed | 2.1 Display switches
| Time, until completion | 2.1 Display switches
| Timer | 2.1 Display switches
| Transfer rate | 2.1 Display switches
U |  |
| Update interval | 2.2 Output modifiers
W |  |
| Wait | 2.2 Output modifiers
| Wait until transfer starts | 2.2 Output modifiers
| Width | 2.2 Output modifiers

Jump to: | B C D E F H I L N O P Q R S T U W

[Top] | [Contents] | [Index] | [ ? ]

# Table of Contents

1. Overview
2. Invocation

2.1 Display switches
2.2 Output modifiers
2.3 General options

Concept Index

[Top] | [Contents] | [Index] | [ ? ]

# Short Table of Contents

> 1. Overview
> 2. Invocation
> Concept Index

[Top] | [Contents] | [Index] | [ ? ]

# About this document

This document was generated by Andrew Wood on February, 27 2006 using texi2html

The buttons in the navigation panels have the following meaning:

Button | Name | Go to | From 1.2.3 go to
--- | --- | --- | ---
[ < ] | Back | previous section in reading order | 1.2.2
[ > ] | Forward | next section in reading order | 1.2.4
[ << ] | FastBack | previous or up-and-previous section | 1.1
[ Up ] | Up | up section | 1.2
[ >> ] | FastForward | next or up-and-next section | 1.3
[Top] | Top | cover (top) of document |
[Contents] | Contents | table of contents |
[Index] | Index | concept index |
[ ? ] | About | this page |

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:

- 1. Section One

- 1.1 Subsection One-One

- ...

- 1.2 Subsection One-Two

- 1.2.1 Subsubsection One-Two-One
- 1.2.2 Subsubsection One-Two-Two
- 1.2.3 Subsubsection One-Two-Three <== Current Position
- 1.2.4 Subsubsection One-Two-Four

- 1.3 Subsection One-Three

- ...

- 1.4 Subsection One-Four

This document was generated by Andrew Wood on February, 27 2006 using texi2html It was then munged by a Perl script to stop it looking horrible in Lynx.