Re:Show HN: Linux tool to show progress for cp, rm, dd, etc.
by fit2rule on Saturday July 12, 2014 @04:53AM
(#8024063)
Yeah .. I think I prefer pv for all my cp progressbar needs .. keeps things light and simple, and is already onboard.
Re:Show HN: Linux tool to show progress for cp, rm, dd, etc.
by __david__ on Saturday July 12, 2014 @05:06AM
(#8024087)
I like pv, but I thought that it didn't work with "cp -r" (let alone mv)… Am I wrong?
It would be nice for cp and mv to just have built-in progress bars (only active in interactive mode, etc).
Re:Show HN: Linux tool to show progress for cp, rm, dd, etc.
by hrjet on Saturday July 12, 2014 @05:22AM
(#8024103)
About 10 years back I tried to do this by defining terminal escape codes for this. I was also implementing a new terminal as a POC. Unfortunately didn't find the time to go beyond it.
Here's the POC if anyone would like to take it further: http://anthias.sourceforge.net/
Re:Show HN: Linux tool to show progress for cp, rm, dd, etc.
by fyrabanks on Saturday July 12, 2014 @05:41AM
(#8024124)
pv is by no means a standard include. Also the obvious advantage here is being able to monitor progress for processes you didn't pipe to pv initially (e.g., forgot or didn't think it would be a long transfer).
Re:Show HN: Linux tool to show progress for cp, rm, dd, etc.
by zurn on Saturday July 12, 2014 @05:45AM
(#8024133)
pv is just cat with a progress bar, so it only handles the case where you are copying a single big file.
Re:Show HN: Linux tool to show progress for cp, rm, dd, etc.
by ithkuil on Saturday July 12, 2014 @06:31AM
(#8024188)
Indeed. You can use it to show the progress of a recursive directory copy with this trick:
tar c -C /tmp/source . | pv | tar x -C /tmp/dest
you can also pass an approximated size of your source to pv, however the tar output will be slightly bigger.
Re:Show HN: Linux tool to show progress for cp, rm, dd, etc.
by ysangkok on Saturday July 12, 2014 @01:53PM
(#8025251)
how would you estimate the size quickly? 'du' can take quite long
Re:Show HN: Linux tool to show progress for cp, rm, dd, etc.
by teraflop on Saturday July 12, 2014 @10:04PM
(#8026399)
You can start pv without an estimated size, run du in the background, and then supply the estimate to pv once it's calculated using the '-R' (remote control) option.
A bit clumsy, but it shouldn't be hard to write a little script to do it.
Re:Show HN: Linux tool to show progress for cp, rm, dd, etc.
by ithkuil on Saturday July 12, 2014 @10:15PM
(#8026417)
Cool, didn't know about that pv had a remote control.
Anyway, if cp -R had a progress bar it would behave the same way, i.e. it would have first to recursively stat the source the same way as du does, and only then it could start reporting a completion percentage.
http://www.catonmat.net/blog/unix-utilities-pipe-viewer/