Linux File Compression tool
tools |
file extension |
|
TD width= "valign=" top >bzip2
.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