Tar/Untar on OSX/Linux with pretty progress bars

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!


comments powered by Disqus