Author Topic: split zip  (Read 1175 times)

KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
split zip
« on: 14 April 2003, 00:52 »
Hey, can somebody remind me of the syntax for splitting a zip file with tar or zip.

Also, will it be possible for the resultant files to be put back together with pkzip/winzip on a winders box?
Contains scenes of mild peril.

jtpenrod

  • VIP
  • Member
  • ***
  • Posts: 675
  • Kudos: 105
split zip
« Reply #1 on: 14 April 2003, 12:54 »
There are a couple of ways to do that. The easiest is to just use the -M or --multi-volume option with tar. That will split a large archive into smaller pieces, such as writing a backup to floppies.

Or you could use the "split" utility.
quote:
`split': Split a file into fixed-size pieces
============================================

   `split' creates output files containing consecutive sections of
INPUT (standard input if none is given or INPUT is `-').  Synopsis:

     split [OPTION] [INPUT [PREFIX]]

   By default, `split' puts 1000 lines of INPUT (or whatever is left
over for the last section), into each output file.

   The output files' names consist of PREFIX (`x' by default) followed
by a group of letters (`aa', `ab', ... by default), such that
concatenating the output files in sorted order by file name produces
the original input file.  If the output file names are exhausted,
`split' reports an error without deleting the output files that it did
create.

   The program accepts the following options.  Also see *Note Common
options::.

`-a LENGTH'
`--suffix-length=LENGTH'
     Use suffixes of length LENGTH.  The default LENGTH is 2.

`-l LINES'
`--lines=LINES'
     Put LINES lines of INPUT into each output file.

     On older systems, `split' supports an obsolete option `-LINES'.
     POSIX 1003.1-2001 (*note Standards conformance:  does not allow
     this; use `-l LINES' instead.

`-b BYTES'
`--bytes=BYTES'
     Put the first BYTES bytes of INPUT into each output file.
     Appending `b' multiplies BYTES by 512, `k' by 1024, and `m' by
     1048576.

`-C BYTES'
`--line-bytes=BYTES'
     Put into each output file as many complete lines of INPUT as
     possible without exceeding BYTES bytes.  For lines longer than
     BYTES bytes, put BYTES bytes into each output file until less than
     BYTES bytes of the line are left, then continue normally.  BYTES
     has the same format as for the `--bytes' option.

`--verbose'
     Write a diagnostic to standard error just before each output file
     is opened.
After doing that, you could then use tar to prepare *.tar.gz or *.tar.bz2 compressed archives. These could then be unloaded, and the individual parts can be cat-ed back together. That might lead to smaller parts than just doing a multi-volume tar.

As for doing this on Winderz, I would tend to doubt it. Since Winderz is largely brain-dead, I doubt they'd have anything so geeky, or so useful , as the equivalent of cat.    
______________________________________
Live Free or Die: Linux

Their fundamental design flaws are completely concealed by their superficial design flaws.
Live Free or Die: Linux
If software can be free, why can't dolphins?

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism