Linux compressed data

Source: Internet
Author: User

Linux File Compression tool

TD width= "valign=" top >bzip2
tools file extension
.bz2 Use the Burrows-wheeler block to sort text compression algorithm
gzip .gz GNU Project compression tool
zip unix version of Windows PKZIP program

1.BZIP2 Tools

bZIP For compressing files
Bzcat Used to display the contents of a compressed text file
Bunzip2 For extracting. bz2 files
Bzip2recover Used to try to repair a corrupted compressed file

Example:

Compress Myprog files with bzip2

[Email protected] ~]# ls-l Myprog

-rw-r--r--1 root root 0 11-06 10:54 Myprog

[Email protected] ~]# bzip2 Myprog

[Email protected] ~]# ls-l my*

-rw-r--r--1 root root 11-06 10:54 myprog.bz2

*****************************************************

Extracting myprog.bz2 files with BUNZIP2

[Email protected] ~]# BUNZIP2 myprog.bz2

[Email protected] ~]# ls-l Myprog

-rw-r--r--1 root root 11-06 10:56 Myprog


2.gzip Tools

Gzip For compressing files
Gzcat Used to display compressed file contents
Gunzip For extracting files

Compression:

[Email protected] ~]# gzip Myprog

[Email protected] ~]# ls-l my*

-rw-r--r--1 root root 11-06 10:56 myprog.gz

Extract:

[Email protected] ~]# gunzip myprog.gz

[Email protected] ~]# ls-l my*

-rw-r--r--1 root root 11-06 10:56 Myprog


3.zip Tools

Zip Create a file containing list files and directories compressed
Zippcloak Create an encrypted compressed file that contains list files and directories
Zipnote Used to extract comments in a zip file
Zipsplit Multiple files for splitting a zip file into a specified size
Unzip Used to extract files and directories in a compressed ZIP file


4.tar Archive Command

Tar is used to archive files, and input can be written to a file

-A --concatenate Add an existing tar archive file to another existing archive
-C --create Create a new tar archive file
-D --diff Check the differences between the TAR archive file and the file system

--delete Delete from an existing tar archive file
-R --append Add a file to the end of an existing tar archive file
-T --list List the contents of an existing tar archive file
-U --update To update files in an existing tar archive
-X --extract Unzip an existing archive file
-C --dir Switch to the specified directory
-F --file Output results to a file or device
-j

To compress the output from directed to the BZIP2 command
-P
Keep all file permissions
-V
List files in process
-Z
Compress the output from the directed to gzip command

[Email protected] ~]# TAR-CVF Test.tar test/test2/

Create an archive named Test.tar that contains the contents of the Test1 and Test2 directories


[Email protected] ~]# TAR-TF Test.tar

Lists (but does not stress) the contents of the tar file Test.tar


[Email protected] ~]# TAR-XVF Test.tar

Unzip the contents of the Test.tar file

This article is from the Linux Operations sharing blog, so be sure to keep this source http://liangey.blog.51cto.com/9097868/1572859

Linux compressed data

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.