Linux packaged compression unzip tar, gzip, bzip2

Source: Internet
Author: User
Tags bz2

Compression and decompression

1 gzip

Gzip test.py #压缩后为test. py.gz

gzip-d test.py.gz #解压文件


2 bzip2

Bzip2 test.py #压缩后为test. py.bz2

bzip2-d test.py.gz #解压文件


3 tar

Options content

-C Create a packaged file

-R append file to packaged document

-T list packaged content

-f Specifies the package name

-j compressed by bzip2 format after packaging

-Z Compression after packaging with gzip format

-X Unpacking file

-C Specify the decompression path

--delete removing a file from a packaged file

--remove-files Delete source files after packaging

Instance:

TAR-CF test.tar/home/#将home目录打包为test. Tar

Tar-czf test.tar.gz/home/#将home目录打包并压缩为test. tar.gz

TAR-ZXF test.tar.gz #将gz文件解压

TAR-CJF test.tar.bz2/home/#将home目录打包并压缩为test. tar.bz2

TAR-JXF test.tar.bz2-c/tmp/#将bz2文件解压到指定目录

Tar-f test.tar-r test.txt #将test. txt Append to package

Tar--delete game.txt-f test.tar #从打包文件中删除game. txt




This article is from the "Practical Linux knowledge and Skills sharing" blog, please be sure to keep this source http://superleedo.blog.51cto.com/12164670/1886181

Linux packaged compression unzip tar, gzip, bzip2

Related Article

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.