<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BigSmoke &#187; pv</title>
	<atom:link href="http://blog.bigsmoke.us/tag/pv/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.bigsmoke.us</link>
	<description>Smokes your problems, coughs fresh air.</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:03:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Monitor the progress of Unix commands with Pipe Viewer (pv)</title>
		<link>http://blog.bigsmoke.us/2010/02/01/pipe-viewer</link>
		<comments>http://blog.bigsmoke.us/2010/02/01/pipe-viewer#comments</comments>
		<pubDate>Sun, 31 Jan 2010 22:23:40 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[pipe-viewer]]></category>
		<category><![CDATA[pv]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1141</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>I just stumbled across the <a href="http://www.catonmat.net/blog/unix-utilities-pipe-viewer/">following post</a> while trying to find out how to <a href="http://blog.bigsmoke.us/2010/01/31/xsel#vim-copy">copy text from VIM using XSel</a> without losing the selected text. It introduces Pipe Viewer, a Unix utility which is a kind of cat with a progress bar.</p>

<p>I emerged it (it&#8217;s in Gentoo (Debian too)) and it works very simple, but allows you to do cooler, more complicated things.</p>

<pre>
# pv emerge.log |gzip >emerge.log.gz
1.24MB 0:00:00 [1.76MB/s] [================>] 100%  
</pre>

<pre>
$ pv -cN source access_log | gzip | pv -cN gzip > access_log.gz
   source: 28.7MB 0:00:00 [32.2MB/s] [=====>] 100%            
     gzip: 2.27MB 0:00:00 [2.54MB/s] [ <=>  ]
</pre>

<p>The first example is easy enough to understand when you mentally substitute <tt>pv</tt> with <tt>cat</tt>. The second example is much cooler. It uses the <tt>-N</tt> flag to make named groups and the <tt>-c</tt> flag to make sure that the output for these groups doesn&#8217;t get garbled.</p>

<p>Read Peteris Krumins’ <a href="http://www.catonmat.net/blog/unix-utilities-pipe-viewer/">article</a> for more cool uses of Pipe Viewer.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2010/02/01/pipe-viewer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

