Common Files extracted under Linux (including RPM, Deb package)
How do I get the suffix named gzip file under Linux?
1. A file with an extension of. A:
#tar XV File.a
2. Files with a. z Extension:
#uncompress file. Z
3. Files with the extension of. GZ:
#gunzip file.gz
4. Files with the extension of. BZ2:
#bunzip2 file.bz2
5. Files with the extension of. Tar.z:
#tar Xvzf File.tar.z
or #compress-dc File.tar.z | How to Xvf-linux under tar? is the file that has the suffix name gzip?
1. A file with an extension of. A:
#tar XV File.a
2. Files with a. z Extension:
#uncompress file. Z
3. Files with the extension of. GZ:
#gunzip file.gz
4. Files with the extension of. BZ2:
#bunzip2 file.bz2
5. Files with the extension of. Tar.z:
#tar Xvzf File.tar.z
or #compress-dc File.tar.z | Tar xvf-
6. Files with the extension of. Tar.gz/.tgz:
#tar Xvzf file.tar.gz
or GZIP-DC file.tar.gz | Tar xvf-
7. Files with the extension of. TAR.BZ2:
#tar xvif file.tar.bz2
or BZIP2-DC file.tar.bz2 | XVF-
8. Files with the extension of. Cpio.gz/.cgz:
#gzip-DC File.cgz | Cpio-div
9. Files with the extension of. Cpio/cpio:
#cpio-div File.cpio
or CPIO-DIVC File.cpio
10. Install files with an extension of. RPM:
#rpm-I. file.rpm
11. Unzip the file with an extension of. RPM:
#rpm2cpio file.rpm | cpio-div
12. Install files with the. deb Extension:
#dpkg-I. File.deb
13. Unzip the file with a. deb extension:
#dpkg-deb--fsys-tarfile File.deb | Tar Xvf-ar P
File.deb data.tar.gz | Tar Xvzf-
14. Files with a. zip extension:
#unzip File.zip
Unzip files in WinZip format under Linux
If you have a JDK, you can use the Jar command, and you can do so with the unzip command.
Unzip the. tar.gz file directly
The xxxx.tar.gz file uses the tar band ZXVF parameter, which can be unpacked at once. XXXX is the file name. For example:
$tar ZXVF xxxx.tar.gz Decompression of various compressed files (installation method)
File name 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[option] File name to compress (or decompress)
-C writes the output to the standard output and retains the original file.
-D compresses the compressed file.
-L Displays the following fields for each compressed file: The size of the compressed file, the size of the uncompressed file, the compression ratio, the name of the uncompressed file
-R recursively finds the specified directory and compresses or compresses all of its files.
The-t test compressed file is just intact.
-V for each compressed and uncompressed file, display its file name and compression ratio.
-num-adjusts the speed of compression with the specified number.
Example:
Make a backup of all files in the/usr directory, including its subdirectories, with the backup file named Usr.tar
Tar cvf usr.tar/home
Make a backup and compress all the files in the/USR directory and include its subdirectories, and the backup file name is usr.tar.gz
Tar czvf usr.tar.gz/usr
Compress a set of files with a suffix of tar.gz
#tar CVF back.tar/back/
#gzip-Q Back.tar
Or
#tar CVFZ back.tar.gz/back/
Releases a file with a suffix of tar.gz.
#tar ZXVF back.tar.gz
#gzip back.tar.gz
#tar XVF Back.tar
Common decompression commands under Linux (reproduced)