Compression and decompression under Linux

Source: Internet
Author: User

Common compression commands

. gz gzip Compression tool files

Files for the. bz2 bzip2 Compression Tool

. Tar Tar Packager package files (tar does not compress function, just merge a directory into one file)

The. Tar.gz can be understood to be packaged with tar first and then compressed in gzip

. tar.bz2 first packed in tar, compressed in bzip2


Gzip Compression Tool

Gzip does not support compressing directories, deleting source files after compression

# gzip [-d#] filename where # is 1-9 digits, compression level, 1 compression is the worst, 9 compression is best, 6 is the default

-D decompression is used

# Gunzip filename can also be decompressed


bZIP Compression Tool

bZIP does not support compression of directories

# bzip [-DKZ] filename

-D Decompression

-K Preserve Source files

-Z compression, do not add-Z can also compress files

# The TAR Pack tool can package a directory into a file for easy copying or moving

# tar [-ZJXCVFPP] filename

-Z Use gzip compression at the same time

-j simultaneous use of bzip compression

-X Unpack or unzip

-T view the files inside the tar package

-C Build a tar package or zip file package

-V Visualization

-F followed by the file name, compressed with "-F file name", meaning the compressed file name is filename, decompression with "-f filename", meaning decompression filename.-f need to write to the last

-P Use the properties of the original file, compress what attributes before compression or what properties

# TAR-ZCVF zhao.tar.gz Zhao #打包目录 Zhao and compressed to. gz format

# TAR-ZXCF zhao.tar.gz #解压缩 zhao.tar.gz


Zip compression tool

Windows Linux Universal

# zip [-R] [file or directory after compression]

-R Compression Directory

# unzip [compressed file]


Compression and decompression under Linux

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.