Compressing Files using the Linux Tar Command

Once in a while I need to compress a bunch of files and directories into a single, easy to transport file that can be later de-compressed as needed.  Sometimes I do this for backup purposes and sometimes just to move websites to new hosts.  What’s nice about the tar command in linux is that it allows you to compress entire directories and all sub directories below it recursively.

To compress a directory, run this tar command:

tar cvzf <output file> <input directory>

just replace <output file> and <input file> respectively and you’ll have yourself a compressed tar file after it’s done executing.

To de-compress a tar file (untar), run this command:

tar xvfz <file name>

Again, if you tared up a directory, vs just a set of files, the untar command will decompress the directory itself retaining the original file structure, nice.

If you just want to look at the contents of a tar file without decompressing anything:

tar tzf <file name>

If you want a little more information on the Tar command, check out Duke’s tar guide

Comments

discount viagra

buy cialis

cialis online

cheap cialis

generic viagra

cialis

buy cialis

cialis

viagra

cialis

cialis online

cialis

buy cialis

buy cialis

cialis

cialis

cialis

cialis

generic viagra

viagra online

cialis online

buy cialis

cheap viagra

viagra online

viagra

cheap cialis

viagra online

cialis

cheap viagra

cheap viagra

cialis online

cialis

discount viagra

cialis online

cheap viagra

buy viagra

generic viagra

generic viagra

buy cialis

generic cialis

cheap cialis

cheapest cialis

cheap cialis

generic cialis

generic viagra

generic viagra

generic viagra

cheap cialis

cheapest cialis

cheap cialis

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
2 + 14 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.