<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://freebsdwiki.net/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://freebsdwiki.net/index.php?action=history&amp;feed=atom&amp;title=Pv</id>
		<title>Pv - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://freebsdwiki.net/index.php?action=history&amp;feed=atom&amp;title=Pv"/>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php?title=Pv&amp;action=history"/>
		<updated>2026-04-30T18:50:12Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.18.0</generator>

	<entry>
		<id>http://freebsdwiki.net/index.php?title=Pv&amp;diff=10978&amp;oldid=prev</id>
		<title>Jimbo at 06:10, 4 January 2009</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php?title=Pv&amp;diff=10978&amp;oldid=prev"/>
				<updated>2009-01-04T06:10:34Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 06:10, 4 January 2009&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Just to make it easy to simulate this kind of thing, in this example what we'll ''actually'' do is compress a bunch of zeros from '''/dev/zero''' and pass ''them'' through [[gzip]] and into a file.&amp;#160; Note that while we use the '''-s 2G''' switch in the first '''pv''' instance, we don't in the second - because the second will actually be measuring [[gzip]]'s ''output'', which we don't know the size of ahead of time... but it's nice to see it while the file is actually being written!&amp;#160; Also note that we use the '''-N''' switch to name each of the progress bars, and the '''-c''' switch to put a line break between them.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Just to make it easy to simulate this kind of thing, in this example what we'll ''actually'' do is compress a bunch of zeros from '''/dev/zero''' and pass ''them'' through [[gzip]] and into a file.&amp;#160; Note that while we use the '''-s 2G''' switch in the first '''pv''' instance, we don't in the second - because the second will actually be measuring [[gzip]]'s ''output'', which we don't know the size of ahead of time... but it's nice to see it while the file is actually being written!&amp;#160; Also note that we use the '''-N''' switch to name each of the progress bars, and the '''-c''' switch to put a line break between them.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/del&gt;'''# dd if=/dev/zero bs=10M count=1024 | pv -s 2G -N dd | gzip - | pv -cN gzip &amp;gt; /home/jrs/zero.bin.gz'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; '''# dd if=/dev/zero bs=10M count=1024 | pv -s 2G -N dd | gzip - | pv -cN gzip &amp;gt; /home/jrs/zero.bin.gz'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  gzip: 1.05MB 0:00:17 [63.8kB/s] [&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;lt;=&amp;gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  ]&amp;#160; &amp;#160; &amp;#160;  &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  gzip: 1.05MB 0:00:17 [63.8kB/s] [&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;lt;=&amp;gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  ]&amp;#160; &amp;#160; &amp;#160;  &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; dd: 1.06GB 0:00:17 [64.3MB/s] [===========&amp;gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; ] 52% ETA 0:00:15&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; dd: 1.06GB 0:00:17 [64.3MB/s] [===========&amp;gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; ] 52% ETA 0:00:15&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key bsdwiki:diff:version:1.11a:oldid:10976:newid:10978 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jimbo</name></author>	</entry>

	<entry>
		<id>http://freebsdwiki.net/index.php?title=Pv&amp;diff=10976&amp;oldid=prev</id>
		<title>Jimbo at 06:09, 4 January 2009</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php?title=Pv&amp;diff=10976&amp;oldid=prev"/>
				<updated>2009-01-04T06:09:04Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 06:09, 4 January 2009&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''pv''' is acronymic for Pipe Viewer, and can be found in the ports tree at /usr/ports/sysutils/pv.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''pv''' is acronymic for Pipe Viewer, and can be found in the ports tree at /usr/ports/sysutils/pv.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This is a very handy console-based tool which gives you a progress bar for any sort of data stream.&amp;#160; For example, if you are using [dd] to clone one drive to another, you'd probably like to have a progress bar available - being able to '''kill -INFO''' the '''dd''' process is better than nothing, but it's far from ideal.&amp;#160; '''pv''' to the rescue:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This is a very handy console-based tool which gives you a progress bar for any sort of data stream.&amp;#160; For example, if you are using &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/ins&gt;[dd&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/ins&gt;] to clone one drive to another, you'd probably like to have a progress bar available - being able to '''kill -INFO''' the '''dd''' process is better than nothing, but it's far from ideal.&amp;#160; '''pv''' to the rescue:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # '''dd if=/dev/ad0 bs=16M | pv | dd bs=16M of=/dev/ad1 '''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # '''dd if=/dev/ad0 bs=16M | pv | dd bs=16M of=/dev/ad1 '''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Just to make it easy to simulate this kind of thing, in this example what we'll ''actually'' do is compress a bunch of zeros from '''/dev/zero''' and pass ''them'' through [[gzip]] and into a file.&amp;#160; Note that while we use the '''-s 2G''' switch in the first '''pv''' instance, we don't in the second - because the second will actually be measuring [[gzip]]'s ''output'', which we don't know the size of ahead of time... but it's nice to see it while the file is actually being written!&amp;#160; Also note that we use the '''-N''' switch to name each of the progress bars, and the '''-c''' switch to put a line break between them.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Just to make it easy to simulate this kind of thing, in this example what we'll ''actually'' do is compress a bunch of zeros from '''/dev/zero''' and pass ''them'' through [[gzip]] and into a file.&amp;#160; Note that while we use the '''-s 2G''' switch in the first '''pv''' instance, we don't in the second - because the second will actually be measuring [[gzip]]'s ''output'', which we don't know the size of ahead of time... but it's nice to see it while the file is actually being written!&amp;#160; Also note that we use the '''-N''' switch to name each of the progress bars, and the '''-c''' switch to put a line break between them.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # '''# dd if=/dev/zero bs=10M count=1024 | pv -s 2G -N dd | gzip - | pv -cN gzip &amp;gt; /home/jrs/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;random&lt;/del&gt;.bin.gz'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; # '''# dd if=/dev/zero bs=10M count=1024 | pv -s 2G -N dd | gzip - | pv -cN gzip &amp;gt; /home/jrs/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;zero&lt;/ins&gt;.bin.gz'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  gzip: 1.05MB 0:00:17 [63.8kB/s] [&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;lt;=&amp;gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  ]&amp;#160; &amp;#160; &amp;#160;  &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  gzip: 1.05MB 0:00:17 [63.8kB/s] [&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;lt;=&amp;gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  ]&amp;#160; &amp;#160; &amp;#160;  &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; dd: 1.06GB 0:00:17 [64.3MB/s] [===========&amp;gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; ] 52% ETA 0:00:15&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; dd: 1.06GB 0:00:17 [64.3MB/s] [===========&amp;gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; ] 52% ETA 0:00:15&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key bsdwiki:diff:version:1.11a:oldid:10975:newid:10976 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jimbo</name></author>	</entry>

	<entry>
		<id>http://freebsdwiki.net/index.php?title=Pv&amp;diff=10975&amp;oldid=prev</id>
		<title>Jimbo at 06:04, 4 January 2009</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php?title=Pv&amp;diff=10975&amp;oldid=prev"/>
				<updated>2009-01-04T06:04:04Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''pv''' is acronymic for Pipe Viewer, and can be found in the ports tree at /usr/ports/sysutils/pv.&lt;br /&gt;
&lt;br /&gt;
This is a very handy console-based tool which gives you a progress bar for any sort of data stream.  For example, if you are using [dd] to clone one drive to another, you'd probably like to have a progress bar available - being able to '''kill -INFO''' the '''dd''' process is better than nothing, but it's far from ideal.  '''pv''' to the rescue:&lt;br /&gt;
&lt;br /&gt;
 # '''dd if=/dev/ad0 bs=16M | pv | dd bs=16M of=/dev/ad1 '''&lt;br /&gt;
 832MB 0:00:30 [  31MB/s] [                            &amp;lt;=&amp;gt;                    ]&lt;br /&gt;
&lt;br /&gt;
Of course, 832MB is probably ''not'' really a little over half of the drive - in this example, '''pv''' can't really tell you when the process will be done, as it doesn't know how large the stream of data to be moved really is.  But it does show you how long you've been running, how much data you've moved, how fast it's been moving, and the progress bar will bounce back and forth so at least you see movement.  A more elegant example in this case would be to pass '''pv''' the actual expected size of the data directly:&lt;br /&gt;
&lt;br /&gt;
 # '''dd if=/dev/ad0 bs=16M | pv -s 512M | dd bs=16M of=/dev/ad1 '''&lt;br /&gt;
 224MB 0:00:08 [31.7MB/s] [==============&amp;gt;                    ] 43% ETA 0:00:10&lt;br /&gt;
&lt;br /&gt;
Much more satisfying!  Now we get a percentage, a solid progess bar, and an ETA.  Note that '''pv''' understands standard size delineations of K, M, and G; so no need to memorize powers of 2 to ridiculous levels.  It's also worth noting that you can pass a stream with multiple stages through multiple '''pv''' instances - for example, what if instead of cloning one drive to another, we were sending its cloned image through gzip to make a compressed image file on a filesystem somewhere?&lt;br /&gt;
&lt;br /&gt;
Just to make it easy to simulate this kind of thing, in this example what we'll ''actually'' do is compress a bunch of zeros from '''/dev/zero''' and pass ''them'' through [[gzip]] and into a file.  Note that while we use the '''-s 2G''' switch in the first '''pv''' instance, we don't in the second - because the second will actually be measuring [[gzip]]'s ''output'', which we don't know the size of ahead of time... but it's nice to see it while the file is actually being written!  Also note that we use the '''-N''' switch to name each of the progress bars, and the '''-c''' switch to put a line break between them.&lt;br /&gt;
&lt;br /&gt;
 # '''# dd if=/dev/zero bs=10M count=1024 | pv -s 2G -N dd | gzip - | pv -cN gzip &amp;gt; /home/jrs/random.bin.gz'''&lt;br /&gt;
     gzip: 1.05MB 0:00:17 [63.8kB/s] [            &amp;lt;=&amp;gt;                         ]       &lt;br /&gt;
      dd: 1.06GB 0:00:17 [64.3MB/s] [===========&amp;gt;            ] 52% ETA 0:00:15&lt;br /&gt;
&lt;br /&gt;
Not bad - now we have progress bars showing us how much of our data we have left to get through, how long it will take us, how big our compressed image has gotten so far, and what basic rate it's growing at.&lt;br /&gt;
&lt;br /&gt;
[[Category: Ports and Packages]]&lt;/div&gt;</summary>
		<author><name>Jimbo</name></author>	</entry>

	</feed>