Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Power of PV ~ Pipeviewer By Ralph Figueroa. Pipeviewer, aka PV What is pv? From the developers website “PV is a terminal-based tool for monitoring.

Similar presentations


Presentation on theme: "The Power of PV ~ Pipeviewer By Ralph Figueroa. Pipeviewer, aka PV What is pv? From the developers website “PV is a terminal-based tool for monitoring."— Presentation transcript:

1 The Power of PV ~ Pipeviewer By Ralph Figueroa

2 Pipeviewer, aka PV What is pv? From the developers website “PV is a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion.”* Available by default within the majority of Linux distributions. *http://www.ivarch.com/programs/pv.shtml

3 Pipeviewer Syntax and Options pv [OPTION] [FILE]... pv [-h|-V] pv file | nc -w 1 somewhere.com 3000 A more complex example using cat: cat file | pv -s 12345 | nc -w 1 somewhere.com 3000 An even more doozy of a script: (tar cf -. \ | pv -n -s $(du -sb. | awk '{print $1}') \ | gzip -9 > out.tgz) 2>&1 \ | dialog --gauge 'Progress' 7 70 Reference: http://www.ivarch.com/programs/pv.shtml

4 Pipeviewer Syntax and Options pv [OPTION] [FILE]... pv [-h|-V] pv file | nc -w 1 somewhere.com 3000 A more complex example using cat: cat file | pv -s 12345 | nc -w 1 somewhere.com 3000 An even more doozy of a script: (tar cf -. \ | pv -n -s $(du -sb. | awk '{print $1}') \ | gzip -9 > out.tgz) 2>&1 \ | dialog --gauge 'Progress' 7 70 Reference: http://www.ivarch.com/programs/pv.shtml

5 Pipeviewer Syntax and Options PV has numerous options that can be implemented for your information tracking needs. http://www.ivarch.com/programs/quickref/pv.shtml Reference: http://www.ivarch.com/programs/quickref/pv.shtml

6 Invoking and Casting the Pipeviewer You have a file called “access.log” and it’s a few gigabytes large. You start to compress into a gunzip archive (.gz): $ gzip -c access.log > access.log.gz You can use PV to see exactly how long it will take for your file to be compressed: $ pv access.log | gzip > access.log.gz Reference: http://www.catonmat.net/blog/unix-utilities-pipe-viewer/

7 Invoking and Casting the Pipeviewer You are using dd, and want to check the progress of your back up. DD will provide you with a progress bar and statistics. sudo dd if=/dev/sdc bs=4096 | pv -s 2G | sudo dd bs=4096 of=~/USB_BLACK_BACKUP.IMG Reference: http://blog.urfix.com/9-tricks-pv-pipe-viewer/

8 Invoking and Casting the Pipeviewer Run a live ssh network throughput test yes | pv | ssh $host "cat > /dev/null" Reference: http://blog.urfix.com/9-tricks-pv-pipe-viewer/

9 Conclusion pv is a useful tool for any Command Line Warrior and should be added to your skillset when ever you are working with Linux. Whether your working with files, timing how fast your computer reads or writes to a disk or testing your network throughput, pv is the open source tool that keeps on giving. HAVE AT IT!!!!!!


Download ppt "The Power of PV ~ Pipeviewer By Ralph Figueroa. Pipeviewer, aka PV What is pv? From the developers website “PV is a terminal-based tool for monitoring."

Similar presentations


Ads by Google