Linux Pipe Viewer
Introduction
Sometimes, we will have to deal with large file copy and compression and decompression. These operations will take very long time and we would like to track the their progresses.
Linux has a tool called pv
, namely pipe viewer, that allows showing the progress bar of file copy, compression, and decompression. In this blog post, I would like to show its usage quickly.
Prerequisites
1 | $ sudo apt update |
Note that pigz
could improve the compression and decompression performance significantly.
Usage
Copy File
1 | $ pv source/data.tar.gz > target/data.tar.gz |
Tape Archive Decompression
1 | $ pv source/data.tar.gz | tar xf - --use-compress-program="pigz -dk -p8" -C target/ |
Tape Archive Compression
1 | $ tar -cf - --use-compress-program="pigz -k -p8" source/data/ | pv -s $(du -sb data/ | awk '{print $1}') > target/data.tar.gz |
References
Linux Pipe Viewer