[CentOS] Bzip2 Compress directories

NiftyCluster Tom Mitchell niftycluster at niftyegg.com
Sun Apr 26 22:15:16 UTC 2009

On Wed, Apr 22, 2009 at 2:23 PM, James Matthews <nytrokiss at gmail.com> wrote:
> Hi,
> How do you get bzip2 to compress directories?

* All the files in a dir? ( you cannot compress the directory itself).

   find dir -type f -print | xargs bzip2 -v
   find dir -type f -print0 | xargs -0 bzip2 -v
   cd dir; bzip2 *

Do you want to Package all the files into a tar or cpio archive
so you can send it to someone else?

        T o m   M i t c h e l l

More information about the CentOS mailing list