Hang on...

TAR compress, extract, bzip2, gzip

Share |
This is a note about how to tar and un-tar files. It serves as a memo as I always forget these commands and have to look them up.

Create a simple tar file:
tar -cvvf archive.tar folder_to_archive/

Extract a tar file:
tar -xf archive.tar

Bzip2 compress folder and it's sub folders, files:
tar -c --bzip2 -f archive.bz2 folder_to_archive/

Bzip2 extract:
tar -jxvf archive.bz2

Gzip compress folder and it's sub folders, files:
tar -cvzpf archive.tar.gz folder_to_archive/

Gzip extract:
tar -zxvf archive.tar.gz

Extract Gzip SQL:
gunzip archive.sql.gz

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <caption> <tbody> <tr> <td> <em> <b> <u> <i> <strong> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike>
  • Web page addresses and e-mail addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].

More information about formatting options