There are a lot of answers on how to create a tar.gz file with progress updates (ie. this answer, copied below)

tar cf - /folder-with-big-files -P | pv -s $(du -sb /folder-with-big-files | awk '{print $1}') | gzip > big-files.tar.gz

But how do I see the progress if I am tarring files without compression like so

tar -cvf output.tar folder/to/tar

While the accepted solution works it is just a bit of an abuse of process. There is a simpler and more elegant/correct solution -

tar -c /folder | pv -s $(du -sb /folder-with-big-files | awk '{print $1}') > bigfiles.tar

tar stands for Tape ARchive - and is designed to deal with streams. the "f" in "cf" tells tar to specifically create a file - rather then do this and specify a "-" to use stdout as this file.

  • Thanks for sharing that, davidgo. Note that the two folder paths (currently showing as /folder and /folder-with-big-files) need to match, as in @Kevin Rockwell's answer. – Miles Wolbe Sep 22 '18 at 1:08

Instead of putting the output through gzip, output to a file: tar cf - /folder-with-big-files -P | pv -s $(du -sb /folder-with-big-files | awk '{print $1}') > big-files.tar

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.