Linux pv Command Tutorial With Examples To Monitor Progress Of Copy/Backup/Compress – POFTUT

Linux pv Command Tutorial With Examples To Monitor Progress Of Copy/Backup/Compress


When copying, moving files or making backups if the operation requires long time we want to know the progress of the operation. By default most of the Linux tools do not provide this ability by native . pv command is an auxiliary tool used to implement the progress bar about the pipe or operation. Pv command can provide following information

  • Time elapsed
  • Completion percentage
  • Remaining Percentage
  • Total data transferred
  • Estimated Time Remaining

Simple Usage

As stated previously pv command will monitor the pipeline or copy operation. We will copy test.deb as  test2.deb and monitor copy process by piping it.

$ cp test.deb test2.deb | pv
Simple Usage
Simple Usage

Show Only Display Bar

We can only show the bar. This will hide all other information.

$ cp test.deb test2.deb | pv -p
Show Only Display Bar
Show Only Display Bar

Show Only Elapsed Time

We can only show the elapsed timer. This will hide all other information.

$ cp test.deb test2.deb | pv --timer
Show Elapsed Time
Show Elapsed Time

Show Only ETA

Tracking estimated time is important.We can show ETA with the --eta option like below.

$ cp test.deb test2.deb | pv --eta

Show Rate

We can only show the rate. This will hide all other information.

$ cp test.deb test2.deb | pv --rate
Show Rate
Show Rate

Show Only Transferred Data Size

We can only show the transferred data size. This will hide all other information.

$ cp test.deb test2.deb | pv --bytes

Refresh Specified Interval

While showing statistics there will be some information refresh. This refresh interval can be specified with -i . In the example we set refresh interval time as 2 seconds.

$ cp test.deb test2.deb | pv -i 2

Version

Version of the pv command can be shown with --version option like below.

$ pv --version
Version
Version

LEARN MORE  What Is URL (Uniform Resource Locator)?

Leave a Comment