size=`wc -c a` ; cp a b & sleep 1 ; ETA 'wc -c b' $size
Every 10 seconds it runs the given command, then gives an ETA to the number you want. It's not a progress bar, but it is a projected time of completion and can easily be extended if you want.
ETA is like pv but for those occasions when you don't have access to the data stream in a pipe. It can be used anytime you can compute a number that indicates how far along you are. Just give it the command to run for itself, or run the command and feed the values to ETA on stdin and it will give you regular estimates of when it will hit the given target.
It also lets your cp run at full speed, unlike when you copy through pv, and is more generic than just checking on the progress of specifically a copy command. It lets you predict the completion time of anything measurable.
I love pv. It's great because it's pretty much a drop-in for "cat" that gives you fancy progress bars. But for copy I tend to use "rsync -aP". It has progress but not a bar and just feels more like a replacement for cp to me.
What? I think the override is fine in an interactive environment.
My team and I use a hack which overrides cd and as well as calling builtin cd it sources a script if it exists from cwd. This means you can get the exact enviroment you need for that working copy of a project.
I use rsync -avzP exclusively now over cp ever since I tried copying ~7000 files from a USB drive and found cp choked less than 10% through. rsync is wonderful.
That doesn't give you a progress bar because it doesn't know how big the data stream will be. You need to pass in some options to pv to give it that information.
On some BSDs (including Mac OS X) there is a signal, SIGINFO, to which cp will respond by printing out a status report. You can send this signal by typing ^T.
http://news.ycombinator.com/item?id=1149364
ETA is like pv but for those occasions when you don't have access to the data stream in a pipe. It can be used anytime you can compute a number that indicates how far along you are. Just give it the command to run for itself, or run the command and feed the values to ETA on stdin and it will give you regular estimates of when it will hit the given target.
It also lets your cp run at full speed, unlike when you copy through pv, and is more generic than just checking on the progress of specifically a copy command. It lets you predict the completion time of anything measurable.