3 ms·
Usually I have used pv. https://linux.die.net/man/1/pv https://linux.die.net/man/1/pv cp pv source > target tar tar czf images.tar.gz image1 image2
by paulddraper 9y ago
Usually I have used pv.
https://linux.die.net/man/1/pv https://linux.die.net/man/1/pv
cp
pv source > target
tar
tar czf images.tar.gz image1 image2 image3 | pv > target
gzip
pv source | gzip > target.gz
# or
gzip < source | pv | target.gz
- thinkofdoc 9y agoI've just recently learned about the usefulness of PV, here is an excellent quick demonstration: https://youtu.be/ui4DFIfqH_U https://youtu.be/ui4DFIfqH_U
- blibble 9y agoyou can give it a pid too -d PID[:FD], --watchfd PID[:FD] Instead of transferring data, watch file descriptor FD of process PID, and show its progress. The pv process will exit when FD either changes to a different file, changes read/write mode, or is closed; other data transfer modifiers - and remote control - may not be used with this option. If only a PID is specified, then that process will be watched, and all regular files and block devices it opens will be shown with a progress bar. The pv process will exit when process PID exits.
- michaelmior 9y agoCool! I love pv and it's one of my favourite utilities but I never knew about this option. Thanks :)
- kchr 9y agoWow, did not know about this. TIL!
- newscracker 9y agoI always use pv when I want to monitor a long running operation, mainly because it shows the rate of progress as well as the ETA for the operation (of course, this is an estimate, but it's still useful). 'man pv' is a short read and is something anyone who want to monitor such things should read.
- flukus 9y agoComes with rate limiting too. "-L 25k" keeps the network guys off my back when I have to copy logs across continents.
- jolmg 9y agoYou mean: gzip < source | pv > target.gz
- paulddraper 9y agoYou are correct, thanks