1826784 Members
1607 Online
109702 Solutions
New Discussion

file size

 
haeman
Frequent Advisor

file size

when I use zip command to compress a directory ( zip -r compressed ora_dir ) , the compressed file is limited at 2G , that mean when the compressed file size is over 2G , the compress process is fail , but if I use tar , the directory is successful to compressed and the file size could be 3G , the ulimit is "unlimited" , can advise what is wrong ? thx
3 REPLIES 3
Stuart Browne
Honored Contributor

Re: file size

That would be the 'zip' tool's fault. It can't handle large-files (files over 2GB).

So now the question that needs to be asked. Is there a particular reason you are using the 'zip' command, instead of tar with either the '-z' (zlib) or '-j' (bzip2) flags? Both provide better compression than the 'zip' tool.

Is there a version of the 'zip' tool that does largefiles? Not that I'm aware of, yet.

The 'zip' 2.x series of commands has the 2GB limit.

The 'zip' 3.x series of commands (that have yet to be released) support 4GB.

From the README on a Fedora 8 system:

We are also working on the new Zip 3.0 and companion UnZip 6.00 that finally support files and archives larger than 4 GB on systems that support large files and include other new features. See the latest betas for details and the new releases when available.

See http://www.info-zip.org/pub/infozip for more details.
One long-haired git at your service...
dirk dierickx
Honored Contributor

Re: file size

as long as you're staying on unix/linux system just stick with gzip, that won't give you any problems and works on any unix.
Steven Schweda
Honored Contributor

Re: file size

> [...] the compressed file is limited at 2G
> [...]

With Info-ZIP Zip 2.x and UnZip 5.x, there's
a 2GB size limit on files being compressed
and on the archive itself. (In a few odd
cases, the limit is 4GB instead of 2GB, but
that's pretty rare.) Zip 3.0 and UnZip 6.0
will remove this restriction. Currently,
they have not yet been released, but source
kits for pre-release ("BETA") versions should
be available at:

ftp://ftp.info-zip.org/pub/infozip/
http://sourceforge.net/project/showfiles.php?group_id=118012

> The 'zip' 3.x series of commands (that have
> yet to be released) support 4GB.

By design, Zip 3.x and UnZip 6.x have no
practical limit on file size, and have been
tested well beyond 4GB.

> See http://www.info-zip.org/pub/infozip for
> more details.

Or, more simply: http://www.info-zip.org/

> Both provide better compression than the
> 'zip' tool.

Zip 3.x and UnZip 6.x (including, I believe,
the current "BETA" kits) can be built to
provide bzip2 compression, too. Newer
public "BETA" kits are expected pretty soon,
and we may yet live to see the actual product
releases.

However, unless you're trying to transport
these files to a non-UNIX-like system, it's
not obvious to me why you would choose Zip
instead of tar+gzip or tar+bzip2.