Linux Packing Tools

From Schmid.wiki
Jump to: navigation, search

Contents

Zipping a Subversion Directory

This command specifically excludes subversion files:

$ zip -r name.zip path/to/dir/ -x \*.svn\*

Compression Test

zip vs. gzip vs. bzip2

The object was to pack a lot of text files (maildir files).

      /|\
BEST   |   4176573 tmp/mail.tar.bz2
       |   4335433 tmp/mail.tar.gz                             |__ same result!
       |   4335554 tmp/mail.tar.zip   <- first tar, then zip   |
       |   4696810 tmp/mail.zip       <- all files zipped individually with 'zip -r tmp/mail.zip mail'
WORST  |  10731520 tmp/mail.tar
      \|/

Using tar with bzip2 yielded the best results.

packing method

These 2 methods yield exactly the same results:

$ tar -cO file1 file2 | bzip2 >files.tar.bz2          <- pipe through bzip2
$ tar -cf files2.tar file1 file2 && bzip2 files2.tar  <- create file and then call bzip2
$ diff -s files.tar.bz2 files2.tar.bz2
Files files2.tar.bz2 and files.tar.bzip2 are identical
Personal tools