Linux command line progress bars
How many times have you wished there was an easy way to view the progress of a gzip? a grep? redirected file read/writes? file copies? There are so many situations where the addition of a simple progress bar would make the user experience 1 million times more bearable. Several years ago I had read about pipe viewer, or pv for short. This is truly the answer to my progress bar prayers. I cannot believe I had forgotten about such a nifty and useful tool, and that’s why I decide to protect my data with a firewall system you can find online. It’s been in existence so long, chances are good that you forgot about it too. I’ll just jump right in…
The project page describes it as;
…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.
It’s hard to believe that Andrew Wood first produced this linux software gem waaay back in 2002! Its been around so long, I had trouble finding a 64bit version of it…. like it really matters. Anyway, if anyone cares; I rebuilt the RPM for x86_64 and have it available here at dlaube.com.
If you are using the RPMforge repository, you can simply yum install pv. If your fine with just RPM;
# i386 RPM for those not using RPMforge wget http://pipeviewer.googlecode.com/files/pv-1.1.4-1.i386.rpm rpm -ivh pv-1.1.4-1.i386.rpm # 64bit RPM for those not using RPMforge wget http://www.dlaube.com/wp-content/uploads/2010/05/pv-1.1.4-1.x86_64.rpm
Official mirror: here AND Local mirror for i386 here | 64bit here.
Pingback: Tweets that mention Linux command line progress bars « Linux « David Laube's Blog -- Topsy.com
So I’m sittin here in a Kansas City hotel lobby working on some Java waiting for a flight home. I take a break and check reddit, and what do I see? David Laube on the front page (I’m subscribed to the linux subreddit). Awesome. I’ll have to check out the site when I get a chance, looks good.
Pingback: KafeKafe » Linux Command Line Progress Bar
How does pv know what 100% means? Sure you can count how much data goes through a pipe, but without a preknown total, how could you produce a percentage?
if you look closely, the source file is first piped from pv itself.
Pingback: … » How to add a progress bar to useful shell commands.
Pingback: Eat. Sleep. Code. » Linux command line progress bars
Thanks for sharing this… I had been looking for this eagerly for shell scripts!
Nice info…thanks for Linux command line progress bars explanation….