Skip to main content

Module 4: Process Management

Lesson 40: pv Command

In this lesson, you'll learn how to use the pv command to monitor the progress of data being transferred through a pipeline in Linux.

thatpv is a terminal-based tool that allows you to monitor the progress of data that is being sent through a pipe.

When using the pv command, it gives you a visual display of the following information:

  • The time that has elapsed.
  • The percentage completed, including a progress bar.
  • Current throughput rate.
  • The total data transferred.
  • The ETA (Estimated Time of Arrival).

Install pv on Linux

The pv command is not installed by default on most Linux distributions. You can install it by following the steps below.

Install pv on RHEL-based Linux:

First, you need to turn on the EPEL repository and then run the following yum or dnf command to install it.

# yum install pv

Or:

# dnf install pv

Install pv on Debian-based Linux:

$ sudo apt-get install pv

Install pv on Other Linux Distributions:

$ sudo emerge -a pv       # Gentoo Linux
$ sudo apk add pv         # Alpine Linux
$ sudo pacman -S pv       # Arch Linux
$ sudo zypper install pv  # OpenSUSE

pv Command Syntax

pv is mostly used with other programs that lack the ability to monitor the progress of an ongoing operation.

You can use it by placing it in a pipeline between two processes, with the appropriate options available.

The standard input of pv will be passed through to its standard output, and progress (output) will be printed on standard error.

It has a similar behavior to the cat command in Linux.

The syntax of the pv command is as follows:

$ pv FILE
$ pv OPTIONS FILE
$ pv FILE > filename.out
$ pv OPTIONS | command > filename.out
$ command1 | pv | command2

pv Command Options

Pro TecMint Β· Root Plan
This Article is for Root Members
Join Root to read the full article and unlock everything

Full Access to Every Article, Course & Certification Track

Join thousands of Linux professionals who use Pro TecMint to advance their careers.

Ad-free access to all premium articles
All courses: Learn Linux, Bash, Golang, Ubuntu and more
RHCSA, RHCE, LFCS & LFCA certification prep
New courses added every month
Private Telegram community & priority support
Root Plan
$8/mo
or $59/year billed annually
Save $37 with annual plan
Start Reading This Article in the Next 60 Seconds
Join Root Plan β†’