linux下 tar解压 gz解压 bz2等各种解压文件使用
方法
快递客服问题件处理详细方法山木方法pdf计算方法pdf华与华方法下载八字理论方法下载
(Linux under tar decompression, GZ decompression, bz2 and other decompression files using methods)
linux下 tar解压 gz解压 bz2等各种解压文件使用方法(Linux
under tar decompression, GZ decompression, bz2 and other
decompression files using methods)
Linux under tar decompression, GZ decompression, bz2 and other
decompression files using methods
.tar
Unpack the xvf FileName.tar: Tar
Packing: Tar CVF FileName.tar DirName
(Note: tar is packed, not compressed!)
-- -- -- -- ---
.gz
Decompress 1:gunzip FileName.gz
Decompress 2:gzip -d FileName.gz
Compression: gzip FileName
.tar.gz and.Tgz
Decompression: tar zxvf FileName.tar.gz
Compression: tar zcvf FileName.tar.gz DirName
-- -- -- -- ---
.bz2
Decompress 1:bzip2 -d FileName.bz2
Decompress 2:bunzip2 FileName.bz2
Compression: bzip2 -z FileName
.tar.bz2
Decompression: tar jxvf FileName.tar.bz2 or tar --bzip xvf
FileName.tar.bz2
Compression: tar jcvf FileName.tar.bz2 DirName
-- -- -- -- ---
.bz
Decompress 1:bzip2 -d FileName.bz
Decompress 2:bunzip2 FileName.bz
Compression: unknown
.tar.bz
Decompression: tar jxvf FileName.tar.bz
Compression: unknown
-- -- -- -- ---
.Z
Decompression: uncompress FileName.Z
Compression: compress FileName
.tar.Z
Decompression: tar Zxvf FileName.tar.Z
Compression: tar Zcvf FileName.tar.Z DirName
-- -- -- -- ---
.zip
Decompression: unzip FileName.zip
Compression: zip FileName.zip DirName
To compress a directory, use the -r parameter, -r recursion.
Example: $zip -r FileName.zip DirName
-- -- -- -- ---
.rar
Decompression: rar x FileName.rar
Compression: rar a FileName.rar DirName
Rar go to: !
After decompression, copy the rar_static to the /usr/bin directory (other directories specified by the $PATH environment variable):
[root@www2 tmp]# CP rar_static /usr/bin/rar
-- -- -- -- ---
.lha
Decompression: LHA -e FileName.lha
Compression: LHA -a FileName.lha FileName
LHA go to:
~ishii/lhaunix/ download!
After decompression, copy the LHA to the /usr/bin directory (other directories specified by the $PATH environment variable):
[root@www2 tmp]# CP LHA /usr/bin/
-- -- -- -- ---
.rpm
Rpm2cpio: FileName.rpm CPIO -div | unpack
-- -- -- -- ---
.deb
Ar P FileName.deb data.tar.gz | unpacked: tar - zxf
-- -- -- -- ---
.tar.Tgz.Tar.gz.Tar.Z.Tar.bz.Tar.bz2.Zip.Cpio.Rpm.Sea.Deb.Slp.Arj.Rar.Ace.Lha.Lzh.Lzx.Lzs.Arc.Sda.Sfx.Lnx.Zoo.Cab.Kar.Cpt.Pit.Sit
Decompression: sEx x FileName.*
Compression: sEx a FileName.* FileName
SEx just calls the relevant program, itself has no compression, decompression function, please note!
SEx go to: !
After decompression, copy the sEx to the /usr/bin directory (other directories specified by the $PATH environment variable):
[root@www2 tmp]# CP sEx /usr/bin/
Common file decompression methods and commands under Linux
System and System
1. file with.A as extension:
#tar XV file.a
2. file with.Z as extension:
#uncompress file.Z
3. file with.Gz as extension:
#gunzip file.gz
4. file with.Bz2 as extension:
#bunzip2 file.bz2
5. file with.Tar.Z as extension:
#tar xvZf file.tar.Z
-dc or #compress file.tar.Z tar xvf |
6. file with.Tar.gz/.tgz as extension:
#tar xvzf file.tar.gz
-dc or gzip file.tar.gz tar xvf - |
7. file with.Tar.bz2 as extension:
#tar xvIf file.tar.bz2
-dc file.tar.bz2 or bzip2 xvf - |
8. file with.Cpio.gz/.cgz as extension:
#gzip -dc file.cgz CPIO -div |
9. file with.Cpio/cpio as extension:
#cpio -div file.cpio
Or CPIO -divc file.cpio
10. file installation with.Rpm as extension:
#rpm -i file.rpm
11. file decompression with.Rpm as extension:
#rpm2cpio file.rpm CPIO -div |
12. file installation with.Deb as extension:
#dpkg -i file.deb
13. file decompression with.Deb as extension:
#dpkg-deb -fsys-tarfile file.deb tar xvf - AR P |
File.deb data.tar.gz tar - xvzf |
14. file with.Zip as extension:
#unzip file.zip
Decompress Winzip file in Linux
If you install JDK, you can use the jar command; you can also use the unzip command.
Direct decompression of.Tar.gz files
Xxxx.tar.gz file using tar with zxvf parameters, you can unpack once. XXXX is the file name. For example:
$tar zxvf xxxx.tar.gz decompression of various compressed files (installation method)
File extension decompression (installation method)
.a ar XV file.a
.Z uncompress file.Z
.gz gunzip file.gz
.bz2 bunzip2 file.bz2
.tar.Z tar xvZf file.tar.Z
Compress -dc file.tar.Z tar xvf - |
.tar.gz/.tgz tar xvzf file.tar.gz
Gzip -dc file.tar.gz tar xvf - |
.tar.bz2 tar xvIf file.tar.bz2
Bzip2 -dc file.tar.bz2 - xvf |
.cpio.gz/.cgz gzip -dc file.cgz CPIO -div |
.cpio/cpio CPIO -div file.cpio
CPIO -divc file.cpio
.rpm/install rpm -i file.rpm
.rpm/extract rpm2cpio file.rpm CPIO -div |
.deb/install dpkg -i file.deb
.deb/exrtact dpkg-deb -fsys-tarfile file.deb tar xvf - |
Ar P file.deb data.tar.gz tar xvzf - |
.zip unzip file.zip
Bzip2 -d myfile.tar.bz2 tar xvf |
Tar xvfz myfile.tar.bz2
X is decompression
V is a complex output
F is the specified file
Z GZ format
Gzip
Gzip[options] compress or decompress filenames
-c writes the output to the standard output and retains the original file.
Compression of compressed files by -d.
-l displays the following fields for each compressed file: the size of the compressed file, the size of the uncompressed file, the compression ratio, and the name of the uncompressed file
-r recursively finds the specified directory and compresses or compresses all the files in it.
-t test compression file is positive and complete.
-v for each compression and decompression of the file, display
its file name and compression ratio.
-num- adjusts the speed of compression with the specified number.
Give an example:
Make a backup of all the files in the /usr directory, including its subdirectories, and backup the file named usr.tar
Tar CVF usr.tar /home
Make a backup and compress all the files in the /usr directory and its subdirectories, and backup the file name is usr.tar.gz
Tar czvf usr.tar.gz /usr
Compress a group of files, the suffix of the file is tar.gz
#tar CVF back.tar /back/
#gzip -q back.tar
Or
#tar cvfz back.tar.gz /back/
Release a file with suffix tar.gz.
#tar zxvf back.tar.gz
#gzip back.tar.gz
#tar xvf back.tar
Category: Linux | | added to the collection | share to I Post Bar | browse (948) | comments (1)