I have a compressed file, and on compression or decompression, I want to get it's final compressed size (for compression) or original compressed size (for decompression).
I have used
wc -c before:
$time xz -fc inputfile.tar | wc -c 1318524 2.132
However, the execution time is significantly more since I am still writing file to disk, instead of when I am using redirect to /dev/null:
$ time xz -fc inputfile.tar > /dev/null 1.671
How do I get compressed size (1318524) with final redirection of data to /dev/null?