It is sometimes needed that you monitor the progress of data through a pipe. After searching around the net, I finally discovered a little terminal-based utility that does exactly that! It’s called Pipe Viewer or just PV. Here is some quick info on how to use this tool.
This program can be inserted into any normal pipeline between two processes to provide visual indication of the progress of data. This is extremely useful when, for example, you use dd to zero-fill a partition or to fill a partition with random data. These operations take rather too long and dd does not provide a visual progress indicator. PV can be inserted between dd input and output, so that it gives some info of the progress of the operation.
Here is what I would use to create an 100MB file full of random data:
# dd if=/dev/urandom bs=1024 count=100000 of=test.file
After hitting the Enter key, you have no clue at what stage this operation is, how fast the file is being created, how long it has taken so far etc.
Inserting PV between dd input and output, all this info is available in real-time:
# dd if=/dev/urandom bs=1024 count=100000 | pv | dd of=test.file
Well, this is just an example. PV proves to be a very useful utility in many cases. Give it a try.
Monitoring a pipe… by George Notaras is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Copyright © 2005 - Some Rights Reserved