{"id":41,"date":"2009-07-16T08:06:10","date_gmt":"2009-07-16T13:06:10","guid":{"rendered":"http:\/\/blog.alanporter.com\/2009-07-16\/counting-down"},"modified":"2009-07-16T08:06:10","modified_gmt":"2009-07-16T13:06:10","slug":"counting-down-with-pv","status":"publish","type":"post","link":"https:\/\/alanporter.com\/blog\/2009\/07\/16\/counting-down-with-pv\/","title":{"rendered":"Counting down with &#8216;pv&#8217;"},"content":{"rendered":"<p>Here&#8217;s a neat tool.<\/p>\n<p>Ever start some long task, and wonder how much longer it has to go?  There&#8217;s a small utility called <a href=\"http:\/\/www.ivarch.com\/programs\/pv.shtml\">pv<\/a> (short for &#8220;pipe viewer&#8221;) that counts time and bytes through a pipe, and it shows a nice progress bar.<\/p>\n<p>Here&#8217;s how I used it to watch a very large file being compressed (note the use of the most excellent <strong>lzma<\/strong> compression utility.<\/p>\n<pre>\n$ pv &lt; winxp.vdi | lzma &gt; winxp.vdi.lzma\n1.79GB 0:21:50 [1.49MB\/s] [===&gt;          ] 10% ETA 3:11:02<\/pre>\n<p>Note that if I had used a different pipe notation, <code>pv<\/code> would not have been able to read the input file size, and therefore it could not make estimates of remaining time.  So instead, it shows you the &#8220;Knight Rider&#8221; scanning eye for progress.<\/p>\n<pre>\n$ cat winxp.vdi | pv | lzma &gt; winxp.vdi.lzma\n5.48MB 0:00:04 [1.27MB\/s] [  &lt;=&gt;         ]<\/pre>\n<p>Nice tool.  Thanks, Andrew!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a neat tool. Ever start some long task, and wonder how much longer it has to go? There&#8217;s a small utility called pv (short for &#8220;pipe viewer&#8221;) that counts time and bytes through a pipe, and it shows a nice progress bar. Here&#8217;s how I used it to watch a very large file being [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,15],"tags":[],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-software","category-tips-tricks","count-0","even alt","author-alan","last"],"_links":{"self":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":0,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"wp:attachment":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}