I have tons of .Z compressed files scattered across various directores and need to see the size of the file within it. I don't plan on uncompressing all the .Z files. Is there a way to see the content (typically 1 file) the size of? I am aware of only zcat, which only cats the file. Thanks! Steve
Asked
Active
Viewed 136 times
0
1 Answers
1
The utility uncompress do not have the option to list the archive (and uncompressed size) like gzip. But you can decompress in memory and count the bytes of decompressed file like this:
uncompress -c archive.Z|wc -c
Romeo Ninov
- 17,484
-
1This is exactly what I was looking for, thanks so much! It worked.... So I assume this works under AIX or Linux and all flavours of the OS, since "Uncompress" must be standard with that switch (flag) across the board? – Steve237 Feb 11 '23 at 15:34
-
1@Steve237, I do not have AIX or HP-UX but it work under Solaris 11 (x86) and RHEL. And you are right, as
uncomporessis available there it should work :) – Romeo Ninov Feb 11 '23 at 15:36
file oneofyourfiles.Zand tell us the exact string you get from that? (I'm a bit worried about the "typically" single file) – Marcus Müller Feb 08 '23 at 06:31