Showing posts with label gzip. Show all posts
Showing posts with label gzip. Show all posts

Tuesday, January 12, 2010

Make a big file into many small files (and back again)

Adapted from this slashdot thread

Create many little files called "chunks00000" etc. from bigfile that are all just under 10MB in size: split -a 5 -b 10MB -d bigfile chunks

Put the chunks back together: cat * > newbigfile

Do the same, except with compression: tar -zc bigfile | split -a 5 -b 10MB -d - chunks

Put the compressed chunks back together: cat chunks000* | tar -zxO > newbigfile

Monday, October 30, 2006

Compression: gzip, zip, bzip2

Which compression tool is the best? Of course, there is no "best tool" -- there are different tools for different jobs. It won't matter for compression of trivial data which method you choose, but when you start handling gigabytes of data, it might be prudent to check some of the following links. This is just a sample of all the compression algorithms out there, of course, and is skewed towards ones used more often on Linux.

General info links (to Wikipedia):

  • Data compression
  • ZIP -- .zip extension, zip and unzip commands; analogous to tar and gzip; used more on Windows
  • Gzip -- .gz extension, gzip and gunzip commands
  • Bzip2 -- .bz2 extension
Comparison links: