Tar/Untar on OSX/Linux with pretty progress bars

Tar/Untar on OSX/Linux with pretty progress bars

Tags
Tips & Tricks
Software Development
Computer Science
Published
December 18, 2013
Author
Randall Hand
URL
On a console, install 'pv' (available from homebrew and apt-get) and then use the following to get a nice progress bar with percentage progress and ETA when decompressing:
pv file.tgz | tar xzf - -C target_directory
And use this when compressing for the same:
SIZE=`du -sk folder-with-big-files | cut -f 1` tar cvf - folder-with-big-files | pv -p -s ${SIZE}k | bzip2 -c > big-files.tar.bz2
 
Works with gzip instead of bzip too!