To get uncompressed size of already compressed file, I can use -l option in gzip utility:
gzip -l compressedfile.gz
However is there a way to get size of compressed file if I am piping the output? For example using this command:
gzip -fc testfile > testfile.gz
or specifically if I am redirecting output somewhere where I might not have direct access (server)
gzip -fc testfile > /dev/null
gzip -fc testfile | ssh serverip "cat > file.gz"
Can this be done? I need either the compression ratio or the compressed size.