-
Notifications
You must be signed in to change notification settings - Fork 3
Tar with a progress bar
Using pv
we can add a progress bar to tar extractions.
pv - Pipe Viewer - is 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.
pv is not installed by default on most systems so on OSX can install with brew, so run brew install pv
and on linux use apt-get install pv
or yum install pv
.
Once installed run:
pv archive.tar.gz | tar -x -C .
Creation is a little more complicated, haven't yet tested but found this post on SuperUser
tar cf - /folder-with-big-files -P | pv -s $(du -sb /folder-with-big-files | awk '{print $1}') | gzip > big-files.tar.gz