Hi, How do you get bzip2 to compress directories? Thanks James -- http://www.astorandblack.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20090423/f75f4621/attachment-0002.html>
On Thu, 23 Apr 2009 00:23:35 +0300 James Matthews wrote:> How do you get bzip2 to compress directories?use tar. tar cvjf mydirectory.tar.bz2 mydirectory That will tar and bzip2 the directory called mydirectory and leave you with a file named mydirectory.tar.bz2 -- MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
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. HTH, Filipe
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). Try: find dir -type f -print | xargs bzip2 -v or find dir -type f -print0 | xargs -0 bzip2 -v or 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? -- NiftyCluster T o m M i t c h e l l