Linux Packaging Compression Tool

Source: Internet
Author: User
Tags unpack

Files compressed with. GZ End gzip Compression tool
gzip+ file name
[[Email protected] ~]# gzip 2.txt
[[email protected] ~]# ls
2.txt.gz Test
gzip-d + Compression Pack
[Email protected] ~]# gzip-d 2.txt.gz
[[email protected] ~]# ls
2.txt Test
Compression directory not supported
[[Email protected] ~]# gzip test
Gzip:test is a directory-ignored
Support for compressing multiple files together
[[Email protected] ~]# gzip 1.txt 2.txt
[[email protected] ~]# ls
1.txt.gz 2.txt.gz Test
Files compressed with the. BZ2 End bzip2 Compression tool
and gzip compression method similarly
. Tar needs to name the Tar wrapper package file (Tar does not compress the function, just merge a directory into one file)
You need to add the package name-F to the end of the combo key after-F
[Email protected] ~]# TAR-CVF all.tar 1.txt 2.txt test
1.txt
2.txt
test/
Test/1.txt
[[email protected] ~]# ls
1.txt 2.txt All.tar Test
See which files are included in the package
[Email protected] ~]# TAR-TF All.tar
1.txt
2.txt
test/
Test/1.txt
Unpack and pack
[Email protected] ~]# TAR-XVF all.tar 1.txt 2.txt test
1.txt
2.txt
test/
Test/1.txt
[[email protected] ~]# ls
1.txt 2.txt All.tar Test
It can be seen that packaging does not disappear, and gzip and bzip2 after decompression the package disappears C is to create a package meaning X is to untie a package meaning V is the meaning of visualization, can be omitted.
. tar.gz need to be named can be understood as first packaged with tar, then gzip compressed
Pack first and then compress in gzip format
[Email protected] ~]# TAR-ZCVF all.tar.gz 1.txt 2.txt test
1.txt
2.txt
test/
Test/1.txt
[[email protected] ~]# ls
1.txt 2.txt All.tar all.tar.gz test
The difference between All.tar and all.tar.gz is that the latter is a compressed file, the former is just packing
Unpack and Unzip
[Email protected] ~]# RM-RF 1.txt 2.txt test/
[[email protected] ~]# ls
All.tar all.tar.gz
[Email protected] ~]# TAR-ZXVF all.tar.gz
1.txt
2.txt
test/
Test/1.txt
[[email protected] ~]# ls
1.txt 2.txt All.tar all.tar.gz test
. tar.bz2 needs to be named Ditto, first packed with tar, then bzip2 compressed
Principle of packaging compression
[Email protected] ~]# TAR-JCVF all.tar.bz2 1.txt 2.txt test
1.txt
2.txt
test/
Test/1.txt
Unpacking and decompression
[Email protected] ~]# TAR-JXVF all.tar.bz2 1.txt 2.txt test
1.txt
2.txt
test/
Test/1.txt
The difference is that Gzip is in Z to indicate the compression decompression bzip2 is compressed by the J representation
————————————————————-
Packaging and packaging compression-F immediately after the file needs to be named, in order to be able to identify which is packaged files, which way to compress the default suffix in their own way named, so as not to forget the packaging files and compression methods.

Linux Packaging Compression Tool

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.