11

I'm getting an error when I try and zip a large file on Linux because it is too large for zip to deal with. Anyone know what commands I can use to get around this?

This is the error I'm getting:

zip error: Entry too big to split, read, or write (file exceeds Zip's 4GB uncompressed size limit)

It is a simple text file, log file in fact.

2
  • 3
    use tar+gzip instead. – moonshadow Aug 5 '11 at 16:18
  • 1
    Just split the file into 1GiB chunks and zip those. Or use a modern compression algorithm, you don't need an archive format in your case. – BatchyX Aug 5 '11 at 16:20
7

use the linux split command to chop your log file into smaller files.

and consider setting up log rotate so this doesn't happen again.

1
  • 2
    Just adding this to support others users if they search for this. I used this command to split the file into 1Gb slices: split -b 1024m access_log2 access_log_ – Matt Rogers Aug 5 '11 at 17:30
15

The basic Zip format has a limit of 4 GB per file. You need to upgrade your zip tool to one that supports Zip64:

$ zip -v
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
...

Zip special compilation options:
        ...
        ZIP64_SUPPORT        (use Zip64 to store large files in archives)

Alternatively, use a different archive format such as 7z or tar.

0

You should combine all parts together.

Multi-part archives are not yet supported (unzip v.6.0), except in conjunction with zip. All parts must be concatenated together. zip 3.0 and later can combine multi-part (split) archives into a combined single-file archive using

zip  -s- inarchive.zip -O outarchive.zip
1
  • Is that zip -s- correct? – Giacomo1968 Jul 26 '20 at 4:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.