gzip multiple files and/or folders
Posted in 2006
Topics: Platform-Specific Issues
Hello, Could anyone tell me how to zip multiple files into one zipfile or a folder into one zipfile? We are using AIX Unix version 4.3. Any help would be greatly appreciated. Aimee
"Aimee" <the_orchidz@yahoo.com> wrote in message news:1223os2kstefnbf@corp.supernews.com... > Hello, > > Could anyone tell me how to zip multiple files into one zipfile or a > folder > into one zipfile? We are using AIX Unix version 4.3. > > Any help would be greatly appreciated. > > Aimee cd <directory containing the files or dircetories you wish to zip up> tar cvf <name of tar file> <name(s) of files or directories> eg cd /opt/informix/10.0 tar cvf /scratch/ids_10.tar .
Neil Truby wrote: > "Aimee" <the_orchidz@yahoo.com> wrote : >> Could anyone tell me how to zip multiple files into one zipfile or >> a folder into one zipfile? We are using AIX Unix version 4.3. > > cd <directory containing the files or dircetories you wish to zip up> > > tar cvf <name of tar file> <name(s) of files or directories> > > eg > > cd /opt/informix/10.0 > > tar cvf /scratch/ids_10.tar . Aimee's message body says 'zip' throughout, but the subject line refers to gzip - which is confusing. There is a program called zip which generates files with the .zip suffix, and it combines archiving multiple files with compression. However, the gzip program (GNU Zip) is very different, generating files with the .gz suffix and not support multiple files. If Aimee is seeking to use 'zip', then typing 'zip' or 'zip -h' will probably produce a help message explaining briefly how to do it. If, on the other hand, Aimee is intending to use gzip, then Neil's answer covers some - but not all - of the process. Specifically, it covers how to deal with multiple files or a directory into a single file, but omits the 'and then compress it' part - apply gzip to the resulting file (eg "gzip - v9 /scratch/ids_10.tar" will generate a file /scratch/ids_10.tar.gz which will be noticeably smaller than the original). If you have GNU tar on the system, you can do it all in a single tar command line: tar -czvf /scratch/ids_10.tar.gz . And, if you have a recent enough version of GNU tar (in the last couple of years), you can use bzip2 compression, which is somewhat more effective than gzip compression: tar -cvjf /scratch/ids_10.tar.bz2 . And, what's more, the same more recent versions will automatically detect which decompressor to use: tar -tvf /scratch/ids_10.tar.bz2 # Automatically uses bzip2 tar -tvf /scratch/ids_10.tar.gz # Automatically uses gzip Finally, people using AIX 4.3 should be aiming to upgrade. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/