Linux compressed package tar

Source: Internet
Author: User
Linux compressed package tarfile extension description. gz compressed package with gzip .. Bz2 is compressed with bzip2 .. The files packed in tar are not compressed .. Tar.gz is packed with tar and compressed with gzip .. Tar. bz... Linux compressed package tar file extension description .gz compressed with gzip .. Bz2 is compressed with bzip2 .. The files packed in tar are not compressed .. Tar.gz is packed with tar and compressed with gzip .. Tar.bz2 is packed with tar and compressed with bzip2. Gzip compression gzip [-cdtv #] [name]-c: outputs the compressed data to the screen and can be written to a file through data stream redirection. -D: extract. -T: check data integrity. -V: displays the compression ratio of source files and compressed files. -#: Compression level. Example compression: The Linux code $ gzip testfile.txt is compressed into a file suffixed with .gz and deleted from the original file. Example: unzip the Linux code $ gzip-d testfile.txt.gz. the decompressed file will generate the original file and delete the extension .gz. Example: compress and retain the source file: The Linux code $ gzip-c testfile.txt> testfile.txt.gz uses redirection to write compressed data to the specified file. Bzip2 compression bzip2 [-cdkzv #] [name]-c: output compressed or decompressed data to the standard output. Standard output generally refers to the screen. -D: extract. -K: retain the original file and will not automatically delete the original file. -Z: compression. -V: displays the compression ratio of the original and compressed files. -#: Compression level. Example compression: The Linux code $ bzip2-z testfile.txt is compressed into the testfile.txt.bz2 file. Example: Linux code $ bzip2-d testfile.txt.bz2 testfile.txt.bz2 is decompressed into the testfile.txt file. Example: Linux code $ bzip2-c testfile.txt> testfile.txt.bz2 gzip and bzip2 are used to compress a single file. Even if the directory is compressed, all files in the directory are compressed separately. Tar package tar [-c |-x |-t] [-j |-z] [-v] [-f filename] [pathname]-c: Create a packaging file. -R: append the file to the end of the package. -U: only new files are updated to the packaged files. -T: list the contents of the package. -X: decompress or decompress the package. -J: use bzip2 for compression or decompression. -Z: compressed or decompressed using gzip. -V: displays the processing process. -P: retain the original permissions of the backup file. It is often used to back up configuration files. -P: retain the absolute path. The backup file can contain the root directory. -- Exclude = PATTERN: the specified file is not included in the package. -F filename: filename indicates the packaging file to be processed. -C dir: extract a specific path. Pathname: name of the file or path to be compressed. Note:-f filename should be put together separately. Otherwise, "tar-zcfv filename" treats v as the package name. Example package and compress: Linux code $ tar-cjv-f ~ /Testpath.tar.bz2 ~ /Testpath Linux code $ tar-czv-f ~ /Testpath.tar.gz ~ /Testpath uses two compression methods respectively, which are packaged and compressed into two files. Example: decompress and decompress the package: Linux code $ tar-xjv-f ~ /Testpath.tar.bz2 $ tar-xzv-f ~ The/testpath.tar.gz unpacking method is implemented in the current path. Linux code $ tar-xjv-f ~ /Testpath.tar.bz2-C/tmp $ tar-xzv-f ~ /Testpath.tar.gz-C/tmp. For example, check the file in the package: Linux code $ tar-tjv-f ~ /Testpath.tar.bz2 $ tar-tzv-f ~ /Testpath.tar.gz

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.