• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Saturday, May 24, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

How to Monitor Progress of (Copy/Backup/Compress) Data using ‘pv’ Command

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
18
VIEWS
Share on FacebookShare on Twitter

Contents

  1. How to Install pv Command in Linux?
    1. On Fedora, CentOS and RHEL
      1. Sample Output
    2. On Debian, Ubuntu and Linux Mint
      1. Sample Output
    3. On Gentoo Linux
    4. Use emerge package manager to install pv command as shown.
    5. On FreeBSD Linux
  2. How Do I use pv Command in Linux?
    1. Some options under display modifiers.
    2. Some options under output modifiers.
  3. Use pv Command with Examples
  4. Summary

When making backups, coping/moving large files on your Linux system, you may want to monitor the progress of an on going operation. Many terminal tools do not have the functionality to allow you to view progress information when a command is running in a pipe.

Read Also: Advance Copy Command to Show Progress Bar While Copying Files in Linux

How to Monitor Progress of (Copy/Backup/Compress) Data using ‘pv’ Command

Show Copy/Backup/Tar File Progress Bar in Linux

In this article, we shall look at an important Linux/Unix command called pv.

Suggested Read: Progress – A Tiny Tool to Monitor Progress for (cp, mv, dd, tar, etc.) Commands

Pv 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:

  1. The time that has elapsed.
  2. The percentage completed including a progress bar.
  3. Shows current throughput rate.
  4. The total data transferred.
  5. and the ETA (estimated Time).

How to Install pv Command in Linux?

This command is not installed by default on most Linux distributions, therefore you can install it by following the steps below.

On Fedora, CentOS and RHEL

First you need to turn on EPEL repository and then run the following command.

# yum install pv
# dnf install pv            [On Fedora 22+ versions]
Sample Output
Dependencies Resolved

=================================================================================
 Package       Arch              Version                   Repository       Size
=================================================================================
Installing:
 pv            x86_64            1.4.6-1.el7               epel             47 k

Transaction Summary
=================================================================================
Install  1 Package

Total download size: 47 k
Installed size: 93 k
Is this ok [y/d/N]: y
Downloading packages:
pv-1.4.6-1.el7.x86_64.rpm                                 |  47 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : pv-1.4.6-1.el7.x86_64                                         1/1 
  Verifying  : pv-1.4.6-1.el7.x86_64                                         1/1 

Installed:
  pv.x86_64 0:1.4.6-1.el7                                                        

Complete!

On Debian, Ubuntu and Linux Mint

# apt-get install pv
Sample Output
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  pv
0 upgraded, 1 newly installed, 0 to remove and 533 not upgraded.
Need to get 33.7 kB of archives.
After this operation, 160 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/universe pv amd64 1.2.0-1 [33.7 kB]
Fetched 33.7 kB in 0s (48.9 kB/s)
Selecting previously unselected package pv.
(Reading database ... 216340 files and directories currently installed.)
Preparing to unpack .../archives/pv_1.2.0-1_amd64.deb ...
Unpacking pv (1.2.0-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up pv (1.2.0-1) ...

On Gentoo Linux

Use emerge package manager to install pv command as shown.

# emerge --ask sys-apps/pv

On FreeBSD Linux

You can use the port to install it as follows:

# cd /usr/ports/sysutils/pv/
# make install clean

OR add the binary package as follows:

# pkg_add -r pv

How Do I use pv Command in Linux?

pv is mostly used with other programs which lack the ability to monitor the progress of a 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 as the cat command in Linux.

The syntax of pv command as follows:

pv file
pv options file
pv file > filename.out
pv options | command > filename.out
comand1 | pv | command2 

The options used with pv are divided into three categories, display switches, output modifiers and general options.

Some options under display modifiers.
  1. To turn on the display bar, use the -p option.
  2. To view the elapsed time, use the –timer option.
  3. To turn on ETA timer which tries to guess how long it will take before completion of an operation, use the –eta option. The guess is based on previous transfer rates and the total data size.
  4. To turn on a rate counter use the –rate option.
  5. To display the total amount of data transferred so far, use the –bytes option.
  6. To display progress inform of integer percentage instead of visual indication, use the -n option. This can be good when using pv with the dialog command to show progress in a dialog box.
Some options under output modifiers.
  1. To wait until the first byte is transferred before displaying progress information, use the –wait option.
  2. To assume the total amount of data to be transferred is SIZE bytes when computing percentage and ETA, use –size SIZE option.
  3. To specify seconds between updates, use the –interval SECONDS option.
  4. Use –force option to force an operation. This option forces pv to display visuals when standard error is not a terminal.
  5. The general options are –help to display usage information and –version to display version information.

Use pv Command with Examples

1. When no option is included, pv commands run with default -p, -t, -e, -r and -b options.

For example, to copy the opensuse.vdi file to /tmp/opensuse.vdi, run this command and watch the progress bar in screencast.

# pv opensuse.vdi > /tmp/opensuse.vdi

How to Monitor Progress of (Copy/Backup/Compress) Data using ‘pv’ Command

2. To make a zip file from your /var/log/syslog file, run the following command.

# pv /var/log/syslog | zip > syslog.zip

How to Monitor Progress of (Copy/Backup/Compress) Data using ‘pv’ Command

3. To count the number of lines, word and bytes in the /etc/hosts file while showing progress bar only, run this command below.

# pv -p /etc/hosts | wc

How to Monitor Progress of (Copy/Backup/Compress) Data using ‘pv’ Command

4. Monitor the progress of creating a backup file using tar utility.

# tar -czf - ./Downloads/ | (pv -p --timer --rate --bytes > backup.tgz)

How to Monitor Progress of (Copy/Backup/Compress) Data using ‘pv’ Command

5. Using pv and dialog terminal-based tool together to create a dialog progress bar as follows.

# tar -czf - ./Documents/ | (pv -n > backup.tgz) 2>&1 | dialog --gauge "Progress" 10 70
How to Monitor Progress of (Copy/Backup/Compress) Data using ‘pv’ Command

Create Dialog Progress Box

Summary

This is a good terminal-based tool that you can use with tools that do not have the ability, to monitor the progress of an operations such as coping/moving/backing up files, for more options check man pv.

I hope you find this article helpful and you can post a comment if you have any ideas to add about using pv command. And if you get any errors while using it, you can as well leave a comment.

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
Previous Post

Mhddfs – Combine Several Smaller Partition into One Large Virtual Storage

Next Post

Pscp – Transfer/Copy Files to Multiple Linux Servers Using Single Shell

Next Post

Pscp – Transfer/Copy Files to Multiple Linux Servers Using Single Shell

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet