GNU/Linux Command – PV

pv — Monitor the progress of data through a Pipe

Summary:

In GNU/Linux system, we can pass the data from process to another through the pipe. Depending upon the amount of data, the transfer time is vary and till the end of the transfer, user will not get any status. pv allows a user to see the progress of data transfer through a pipe, with info such as time elapsed, percentage completed with progress bar, current speed, data transferred, and ETA.

Examples:
$ cat 100MB.txt | pv | cat - > /dev/null -- Show transfer with a progress bar, timer, estimated time, transfer rate and byte counter. $ cat 100MB.txt | pv -p | cat - > /dev/null -- Show only progress bar. $ cat 100MB.txt | pv -r | cat - > /dev/null -- Show only rate counter. $ cat 100MB.txt | pv -W | cat - > /dev/null -- Wait until the 1st byte get transferred. $ cat 100MB.txt | pv -l | cat - > /dev/null -- Instead of bytes, show the number of lines got transferred. $ cat 100MB.txt | pv -i 0.5 | cat - > /dev/null -- Update the output every 500ms. Default is 1sec. $ cat 100MB.txt | pv -N Bharathi | cat - > /dev/null -- Prefix the output with the given string "Bharathi". $ cat 100MB.txt | pv -L 100k | cat - > /dev/null -- Limit the data transfer rate to 100KB. $ cat 100MB.txt | pv -B 100 | cat - > /dev/null -- Limit the data transfer rate to 100B. $ pv -R 1234 -L 200k -- Already a PV is running with 100K rate limit and PID is 1234. This command will increase the rate to 200k. $ pv -R 1234 -B 200 -- Already a PV is running with 100B rate limit and PID is 1234. This command will increase the rate to 200B.
Read: man pv

Advertisements
Tagged with: ,
Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: