[CentOS] Bzip2 Compress directories

Robert Heller heller at deepsoft.com
Thu Apr 23 00:29:52 UTC 2009

At Wed, 22 Apr 2009 17:30:51 -0400 CentOS mailing list <centos at centos.org> wrote:

> Hi,
> On Wed, Apr 22, 2009 at 17:23, James Matthews <nytrokiss at gmail.com> wrote:
> > How do you get bzip2 to compress directories?
> You use "tar" to create a tar with the directory contents, and then
> bzip2 to compress that tarfile.
> You can use the "-j" option of tar to bzip2 on the fly.
> This is probably what you want:
> $ tar -cvjf filename.tar.bz2 dirname/
> Replace "filename" and "dirname" with something that is appropriate to you.

Note that is also possible to use dump or cpio as well.  Unlike the
MS-Windows zip/unzip, which combines compressing and archiving in a
single program, the 'UNIX' way is to separate these functions.  bzip2
only compresses.  Other programs (tar, dump, cpio) create archives -- 
bundle a group of files and/or directory trees into a single file.

> HTH,
> Filipe
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos

Robert Heller             -- 978-544-6933
Deepwoods Software        -- Download the Model Railroad System
http://www.deepsoft.com/  -- Binaries for Linux and MS-Windows
heller at deepsoft.com       -- http://www.deepsoft.com/ModelRailroadSystem/

More information about the CentOS mailing list