Install pv Pipe Viewer on Ubuntu 26.04

Install pv Pipe Viewer on Ubuntu 26.04

The pv (Pipe Viewer) is a command-line utility that monitors data passing through a pipeline. It can display useful transfer information such as the amount of data processed, elapsed time, transfer rate, and progress. This makes pv particularly useful when working with large files, archives, backups, and other long-running shell operations. This tutorial explains how to install pv pipe viewer on Ubuntu 26.04.

Install pv

Begin by updating the local package index:

sudo apt update

Install the pv using the command:

sudo apt install -y pv

After installation, check the installed pv version to make sure the command is available:

pv --version

Testing pv

A simple test can be performed by creating a 1 GiB file containing randomly generated data:

dd if=/dev/urandom of=testdata bs=1M count=1024

The generated file can then be compressed with tar command while passing the output through pv:

tar czf - testdata | pv > testdata.tar.gz

During the operation, pv displays the transfer progress and current throughput. A typical output may look like this:

162MiB 0:00:04 [39.9MiB/s] [         <=>                               ]

The displayed information provides an indication of how much data has passed through the pipeline, how long the operation has been running, and the current transfer speed.

Uninstall pv

If pv is no longer needed, remove the package by using the following command:

sudo apt purge --autoremove -y pv

Leave a Comment

Cancel reply

Your email address will not be published.