Compression decompression command under Linux

Source: Internet
Author: User

1. Linux zip command

Compression

Zip-r filename.zip./*//Compress all files and folders in the current directory into filename.zip files

-R means recursive compression of all files in subdirectories

Extract

 unzip-d test Filename.zip//Extract the Filename.zip file to./test
-d:-d test indicates that the file is extracted to the./test directory;

2. Linux tar command

-C: Create compressed archives

-X: Unzip

-T: View content

-J: Compression/decompression via BZIP2 support, at which time the file is preferably *.tar.bz2

-Z: Compression/decompression with GZIP support, at which point the file is preferably *.tar.gz

-F FileName: The file name to be processed after

-C DirName: Unzip in dirname directory

Compression

TAR–CVF Filename.tar *//package All files in the directory into Filename.tar

TAR–ZCF filename.tar.gz *//pack All the files in the directory into Filename.tar, and compress them in gzip to generate a gzip compressed package named filename.tar.gz

TAR–JCF filename.tar.bz2 *//pack All the files in the directory into Filename.tar, and compress them with bzip2, generate a bzip2 compressed package named filename.tar.bz2

TAR–ZCF Filename.tar.z *//pack All the files in the directory into Filename.tar, and compress them with compress, generate a umcompress compressed package named Filename.tar.z

Extract

TAR–XVF Filename.tar//Unpacking the TAR Package

TAR-ZXVF filename.tar.gz//Decompression tar.gz

TAR-JXVF filename.tar.bz2//Decompression tar.bz2

TAR-ZXVF filename.tar.z//Unzip tar. Z

3. linux rar command

To process A. rar file under Linux, you need to install RAR for Linux

Yum install rar

Compression

RAR a filename *//compress all files into a RAR package named Filename.rar

Extract

Unrar e Filename.rar Test//Extract all files from Filename.rar to./test

Compression decompression command 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.