-z, --gzip
filter the archive through gzip

print total bytes after processing the archive; with an argument - print total bytes when this SIGNAL is delivered; Allowed signals are: SIGHUP, SIGQUIT, SIGINT, SIGUSR1 and SIGUSR2; the names without SIG prefix are also accepted

Consider for example the command from this answer:

tar --totals=USR1 -czf output.tar input.file
Total bytes written: 6005319680 (5.6GiB, 23MiB/s)

Does this print the total bytes before or after passing them to gzip?

"bytes written" implies that it's the number of bytes written to disk, but I have currently a running job where tar claims double the number of bytes written than the target destination tar.gz file is taking up according to ls -lah.
Hence, I assume that it is actually "bytes that would have been written" but I cannot find documentation on that behaviour.

I am running tar (GNU tar) 1.27.1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.