At Wed, 22 Apr 2009 17:30:51 -0400 CentOS mailing list centos@centos.org wrote:
Hi,
On Wed, Apr 22, 2009 at 17:23, James Matthews nytrokiss@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@centos.org http://lists.centos.org/mailman/listinfo/centos