tar.gz file naming and compression decompression method

Source: Internet
Author: User
Tags gz file

tar.gz file naming

Tar this is the file that is punched into a package, without compression;

GZ with gzip marked package. tar file compression;

So it becomes 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

Extract

TAR-ZXVF xxx.tar.gz

This will generate a directory 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. Usage of gzip


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. Compress with one command
#tar CVF-/etc/| GZIP-QC > backup.tar.gz


4. Release with one command complete
#gunzip-C backup.tar.gz | Tar xvf-


5. How to untie tar. Z 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 's bag?
#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 folder
Note: the. bz2 non-compressed format is not used frequently. Can man bzip2

8. How do I unzip the tar.bz2 bag?

Tar jxf linux-2.8.18.8.tar.bz2

tar.gz file naming and compression decompression method

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.