Skip to content

Instantly share code, notes, and snippets.

@pavlov99
Created April 4, 2017 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavlov99/a8b7045496776aff6d58607806a12d6c to your computer and use it in GitHub Desktop.
Save pavlov99/a8b7045496776aff6d58607806a12d6c to your computer and use it in GitHub Desktop.
# Install linux pipe viewer and optional dialog
sudo apt-get install dialog
# Archive:
tar cf - /folder-with-big-files -P | pv -s $(du -sb /folder-with-big-files | awk '{print $1}') | gzip > big-files.tar.gz
# OSX:
tar cf - /folder-with-big-files -P | pv -s $(($(du -sk /folder-with-big-files | awk '{print $1}') * 1024)) | gzip > big-files.tar.gz
# Unarchive:
pv file.tgz | tar xzf - -C target_directory
# Unarchive with dialog (nicer command line view)
(pv -n file.tgz | tar -xzf - -C target_directory ) 2>&1 | dialog --gauge "Extracting file..." 6 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment