Any slick way to go from Z to gz??


 
Thread Tools Search this Thread
Operating Systems Solaris Any slick way to go from Z to gz??
# 1  
Old 09-22-2011
Question Any slick way to go from Z to gz??

Morning Everyone,

I'm still rather new to Unix and please forgive me if this is a simple question.

I have a bunch of old zipped files, ending in Z. Is there a way to gzip them -9, without having to uncompress/recomress? I am trying to get them max compressed.

Thank you!!

Last edited by smckech1972; 09-22-2011 at 09:37 AM.. Reason: Adding additional Information.
# 2  
Old 09-22-2011
Something like?

Code:
uncompress -c file.Z | gzip -9c > file.gz

# 3  
Old 09-22-2011
Quote:
Originally Posted by scottn
Something like?

Code:
uncompress -c file.Z | gzip -9c > file.gz

one more detail, space is very limited. I doubt I have enough room to uncompress/recomress. In this suggestion, is that what would happen?

I suppose gzip cannot further compress an existing zip file?

As in the Windows world, I could RAR a zip file and further compress it.
# 4  
Old 09-22-2011
You must have enough free space to accomodate the new .gz file, before deleting the .Z file. The .Z file itself is not uncompressed to disk.

Even if gzip could further compress the .Z file, you still need enough space to store the .gz file while it's being created.

If space is so tight that you don't have enough room for the .gz file, then gzip it to another filesystem first. And depending on what's in the file, and the size and number of files, there's no guarantee that gzip will save you much anyway.
# 5  
Old 09-22-2011
Ok, I'll give you command a shot and see if I can find some temp space to move them. Thank you again for your help, much appreciated!
# 6  
Old 09-22-2011
it is not a good idea trying to compress something that is already compressed. even if it works, you'd get much better ratio with unpacking first.
also archive is simpler.

btw, if you want max compression, try 7z (p7zip). with enough RAM for dictionary it can give very good results.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question