2010年5月9日 星期日

Compression & Decompression

Compression & Decompression
by Jing (mqJing@msn.com)

Compress

    $tar -jcv filename.tar.bz2 source_folder_or_file

            -j, filter archive through bzip2
            -c, create a new archive
            -v, verbosely list files processed

    $tar -pczf name_of_your_archive.tar.gz /path/to/directory

        -p, --same-permissions, --prserve-permissions
        -c, create a new archive
        -z, filter the archive through gzip
        -f, use archive file
     
            

Decompress
    $tar -jxv filename.tar.bz2 -C where_is_the_location 

            -x, extract files from an archive

Reference:
    [2] man tar