How to Monitor the Progress of Linux Commands (With pv and progress)

Share
  • July 19, 2019

Fatmawati Achmad Zaenuri/Shutterstock.com

Instead of flying blind, use the Linux pv and progress commands to track a command’s progress. These utilities will give you progress bars for commands that don’t normally have any. You’ll see an estimated time until completion, too.

If you are on a long haul flight on an aircraft without video screens in the seatbacks, it isn’t easy to know how far through your journey you are. You know when you took off. You know how long the flight is expected to take. But how do you know if you are on track, on time, or way behind schedule? If you don’t want to watch the in-flight movie you can usually switch your video screen to show a map with the position of your aircraft on it. You also get some statistics, such as an expected time of arrival (ETA), which is great.

Starting a command from the terminal window can sometimes feel like a long-haul flight without a video screen. You have nothing to give any indication if all is well or if the process has hung, nor how close to completion it is. A flashing cursor isn’t very informative.

The pv and progress commands give you some statistics and a little visual feedback. You can see how close the process is to complete. That means you get an ETA for your running processes. Compared with staring at a cursor, that wins hands down.

Installing pv

You must install pv.

To install pv on Ubuntu use this command:

sudo apt-get install pv

sudo apt-get install pv in a terminal window

To install pv on Fedora use this command:

sudo dnf install pv

sudo dnf install pv in a terminal window

Read the remaining 74 paragraphs

Source : How to Monitor the Progress of Linux Commands (With pv and progress)