Mac's tar decompression and compact GZ Package command

Source: Internet
Author: User
Tags compact gz file

tar [-cxtzjvfppn] files and directories ....
Parameters:
-C: Create a compressed file parameter directive (the meaning of Create);
-x: Unlock the parameter instructions for a compressed file!
-T: View the files inside the Tarfile!
In particular, in the release of the parameters, c/x/t can only exist one! Cannot exist at the same time!
Because it is not possible to compress and decompress simultaneously.
-Z: Do you have the properties of gzip at the same time? i.e. do I need gzip compression?

Example one: Package all the files in the/etc directory into/tmp/etc.tar
[[email protected] ~]# TAR-CVF/TMP/ETC.TAR/ETC <== package only, do not compress!
[[email protected] ~]# tar-zcvf/tmp/etc.tar.gz/etc <== packaged, compressed with gzip

Example two: Check out what files are in the above/tmp/etc.tar.gz file?
[Email protected] ~]# tar-ztvf/tmp/etc.tar.gz
# because we use gzip compression, so to check the file in the tar file,
# you have to add Z to this parameter! It's important!

Example three: Extracting the/tmp/etc.tar.gz file under/USR/LOCAL/SRC
[Email protected] ~]# CD/USR/LOCAL/SRC
[Email protected] src]# tar-zxvf/tmp/etc.tar.gz

Mac's tar decompression and compact GZ Package command

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.