Click to See Complete Forum and Search --> : gziping stuff


Nameless
03-14-2002, 10:16 PM
Hey,
I want to zip a bunch of files. How do I?
I tried to read the man file but....well....you know.

Anyways, all I want to do it zip/gzip a bunch of files.

Info: Slack 8, 2.4.17 etc

thanks

2thumbs
03-14-2002, 10:29 PM
You can only zip one file. So you must create a tar archive first, then bzip2/gnuzip it.

Nameless
03-14-2002, 10:50 PM
how do i make a tar archive?

2thumbs
03-14-2002, 11:05 PM
man tar :)

tar -c file.tar file1 file2 file3 file4

HelicalCynic
03-15-2002, 12:47 AM
funny thing about tar is you can automagically compress the tar file by adding z or y (gzip or bzip2) to the options. So...


tar cyvf newarchive.tar.bz2 file1 file2 file3

or

tar czvf newarchive.tar.gz file1 file2 file3

smokybobo
03-15-2002, 02:35 PM
Originally posted by 2thumbs:
<STRONG>You can only zip one file. So you must create a tar archive first, then bzip2/gnuzip it.</STRONG>

Actually only true for gzip files. The zip utility creates pkzip compatible zip files.

From zip(1):

'zip is a compression and file packaging utility for Unix, VMS, MSDOS, OS/2, Windows NT, Minix, Atari and Macintosh, Amiga and Acorn RISC OS.

It is analogous to a combination of the UNIX commands tar(1) and compress(1) and is compatible with PKZIP (Phil Katz's ZIP for MSDOS systems).'

For zipping a whole bunch of files (not directories):

zip zipfilename file1 file2 file3....

or to zip directory structure:

zip -r zipfilename file1 file2 file3...

2thumbs
03-15-2002, 02:39 PM
Sorry.. when mentioning zip I ment GNUzip. "zip" can contain multiple files. Oh and on some platforms, the switch to do bzip2 is not -y, but -j (Mandrake for example).

[ 15 March 2002: Message edited by: 2thumbs ]

Nameless
03-18-2002, 01:45 AM
Cool.....

Thanks!