Link to home
Start Free TrialLog in
Avatar of DavidLearns
DavidLearns

asked on

uncompress/compress a whole folder in UNIX

Hi, Can anybody show me how to uncompress/compress a whole folder?  The folder structures should remain the same and only the files are uncompressed/compressed.  Thanks.

David
Avatar of griessh
griessh
Flag of United States of America image

Hi DavidLearns,

Why don't you use gzip -r?

Another option would be to 'tar' first and the zip the file

======
Werner
Avatar of DavidLearns
DavidLearns

ASKER

Griessh, actually I am trying to uncompress a folder which I believe was compresssed.  And only the files were compressed and folders were not. David
SOLUTION
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> folders were not
a folder can't be compressed, because it is only a structural element. The content of a file however can be compressed.
So, are you saying you have a folder with compressed files ????
Hi,

to make it generic, you could just say -

$ find /sourcedir/ -name "*" -exec compress {} \;

This would compress any files that it finds in /sourcedir.

Regards,
Kusuma
kusuma.

What's the point in trying to compress folders, links, devices, FIFO's etc?

Why use compress instead of gzip or bzip2?