tar.gz file naming and compression decompression method

Source: Internet
Author: User
Tags bz2 gz file
tar.gz file naming

Tar is to make a file into a package, not compressed;

GZ is compressed with a. Tar file that is packed in gzip.

So it became a. tar.gz file

Compression

# tar Cvfz backup.tar.gz/xxx/

-C,--create
Create a new archive

-V,--verbose
verbosely List Files processed

-F,--file [hostname:]f
Use archive file or device F (default/dev/rmt0)

-Z,--gzip,--ungzip
Filter the archive through Gzip decompression

TAR-ZXVF xxx.tar.gz

This will generate a folder named after the file name

-Z,--gzip,--ungzip
Filter the archive through gzip

-X,--extract,--get
Extract files from an archive

-V,--verbose
verbosely List Files processed

-F,--file [hostname:]f
Use archive file or device F (default/dev/rmt0)

view a list of files

Tar-tvzf *.tar.gz

-T,--list
List the contents of an archive

remaining Options

-R,--append
Append files to the end of an archive Read more:tar,gzip how to use


1. Compress a set of files as tar.gz suffixes.
# tar cvf backup.tar/etc # gzip-q Backup.tar
Or
# tar Cvfz backup.tar.gz/etc/


2. Release a file with a suffix of tar.gz.
# gunzip backup.tar.gz #tar xvf Backup.tar
Or
# tar Xvfz backup.tar.gz


3. Complete the compression with one command
#tar CVF-/etc/| GZIP-QC > backup.tar.gz


4. Complete the release with one command
#gunzip-C backup.tar.gz | Tar xvf-


5. How to unpack the tar. Z's file.
# tar Xvfz backup.tar.z
Or
# uncompress Backup.tar.z #tar xvf Backup.tar


6. How to unlock the. tgz file.
#gunzip backup.tgz


7. How to compress and decompress. bz2 package.
#bzip2/etc/smb.conf This compresses the file smb.conf into smb.conf.bz2
#bunzip2/etc/smb.conf.bz2 This will restore smb.conf.bz2 to smb.conf in the current directory
Note: the. BZ2 compression format is not very common and can be man bzip2

8. How to unzip the TAR.BZ2 package.

Tar jxf linux-2.8.18.8.tar.bz2

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.