Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Zip & Split a large file

Charles MOct 18 2018 — edited Oct 18 2018

Hi All,

I'm trying to zip a large file, approx. 57 GB. But, I'd also like to split it into individual, zipped pieces. So far, I have not been successful. Could someone help out with the correct command?

Let's call this file 'dummy.txt' (it is a text file) for the purposes of this discussion.

I tried:

zip - s 2g dummy.zip dummy.txt

zip error: Invalid command arguments (cannot write zip file to terminal)

Manual pages show -s as being a valid option.

s splitsize
     --split-size splitsize
          Enable creating a split archive and set the split size.
          A  split archive is an archive that could be split over
          many files.  As the archive is created, if the size  of
          the  archive  reaches  the  specified  split size, that
          split is closed and the next split opened.  In  general
          all  splits but the last will be the split size and the
          last will be whatever is left.  If the  entire  archive
          is smaller than the split size a single-file archive is
          created.

          Split archives are stored in numbered files.  For exam-
          ple,  if  the output archive is named archive and three
          splits are required, the resulting archive will  be  in
          the   three   files   archive.z01,   archive.z02,   and
          archive.zip.  Do not  change  the  numbering  of  these
          files  or the archive will not be readable as these are
          used to determine the order the splits are read.

          Split size is a number optionally followed by a  multi-
          plier.   Currently  the number must be an integer.  The
          multiplier can currently be one  of  k  (kilobytes),  m
          (megabytes),  g  (gigabytes), or t (terabytes).  As 64k
          is the minimum split size, numbers without  multipliers
          default  to  megabytes.  For example, to create a split
          archive called foo with the contents of the bar  direc-
          tory  with  splits  of  670 MB that might be useful for
          burning on CDs, the command:

               zip -s 670m -r foo bar

   could be used.

          Currently the old splits of a  split  archive  are  not
          excluded  from  a new archive, but they can be specifi-
          cally excluded.  If possible, keep the input and output
          archives  out  of  the  path being zipped when creating
          split archives.

          Using -s without -sp as above creates  all  the  splits
          where  foo  is  being written, in this case the current
          directory.  This split mode updates the splits  as  the
          archive  is  being  created,  requiring  all  splits to
          remain writable, but creates split  archives  that  are
          readable  by  any  unzip  that supports split archives.
          See -sp below  for  enabling  split  pause  mode  which
          allows  splits  to  be  written  directly  to removable
          media.

          The option -sv can be used to enable verbose  splitting
          and provide details of how the splitting is being done.
          The -sb option can be used to ring the  bell  when  zip
          pauses for the next split destination.

          Split archives  cannot  be  updated,  but  see  the  -O
          (--out)  option  for how a split archive can be updated
          as it is copied to a new archive.  A split archive  can
          also  be  converted  into a single-file archive using a
          split size of 0 or negating the -s option:
    split size of 0 or negating the -s option:

               zip -s 0 split.zip --out single.zip

I'm indifferent to how it is done, and have seen that maybe I need to use a combination of split and zip commands??

OS:

Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC

  Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.

                            Assembled 17 January 2013

Regards,

Charles

This post has been answered by Andris Perkons-Oracle on Oct 18 2018
Jump to Answer
Comments
Post Details
Added on Oct 18 2018
6 comments
1,624 views