Home  >  Article  >  php教程  >  Linux command to decompress rpm package and introduction to rpm command usage

Linux command to decompress rpm package and introduction to rpm command usage

高洛峰
高洛峰Original
2017-01-07 13:47:132254browse

rpm is a Red Hat (RedHat) software package management tool that implements add/remove program functions similar to Windows.

rpm -ivh install_rpm

tar xvf informix-linux.tar

Complete list of decompression commands under Linux

.tar
Unpacking: tar xvf FileName.tar
Packaging: tar cvf FileName.tar DirName
(Note: tar is packaging, Not compressed! )
——————————————
.gz
Decompression 1: gunzip FileName.gz
Decompression 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
Decompression 1: bzip2 -d FileName.bz2
Decompression 2: bunzip2 FileName.bz2
Compression: bzip2 -z FileName
.tar .bz2
Decompression: tar jxvf FileName.tar.bz2
Compression: tar jcvf FileName.tar.bz2 DirName
——————————————
.bz
Decompression 1: bzip2 -d FileName.bz
Decompression 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
Unzip: unzip FileName.zip
Compression: zip FileName.zip DirName
————————————————
.rar
Unzip: rar x FileName.rar
Compression: rar a FileName.rar DirName
————————————————
.lha
Decompression: lha -e FileName.lha
Compression: lha -a FileName.lha FileName
————————————————
.rpm
Unpack: rpm2cpio FileName.rpm | cpio -div
———— ————————————
.deb
Unpack: ar p FileName.deb data.tar.gz | tar zxf -
———————————— ————
.tar .tgz .tar.gz .tar.Z .tar.bz .tar.bz2 .zip .cpio .rpm .deb .slp .arj .rar .ace .lha .lzh .lzx . lzs .arc .sda .sfx .lnx .zoo .cab .kar .cpt .pit .sit .sea
Decompression: sEx x FileName.*
Compression: sEx a FileName.* FileName

sEx only calls related programs and does not have compression or decompression functions. Please note!

gzip command

Reducing file size has two obvious benefits. One is that it can reduce storage space, and the other is that when transferring files through the network, it can reduce the transmission time. gzip is a command commonly used in Linux systems to compress and decompress files. It is convenient and easy to use.
Syntax: gzip [options] Compressed (decompressed) file name The meaning of each option of this command is as follows:

-c writes the output to the standard output and retains the original file. -d Decompress the compressed file. -l For each compressed file, display the following fields: Size of the compressed file; Size of the uncompressed file; Compression ratio; Name of the uncompressed file -r Recursively search the specified directory and compress or decompress all files in it. -t test, check whether the compressed file is complete. -v For each compressed and decompressed file, display the file name and compression ratio. -num adjusts the compression speed with the specified number num, -1 or --fast indicates the fastest compression method (low compression ratio), -9 or --best indicates the slowest compression method (high compression ratio). The system default value is 6. Instruction example:
gzip *% Compress each file in the current directory into a .gz file. gzip -dv *% Decompress each compressed file in the current directory and list detailed information. gzip -l *% displays detailed information about each compressed file in Example 1 without decompressing it. gzip usr.tar% compresses the tar backup file usr.tar, and the extension of the compressed file is .tar.gz.

Introduction to the use of rpm command

What is rpm? rpm is the abbreviation of RPM package manager. It was the software package standard first proposed by RedHat. Later, with the continuous development of rpm, many functions were added, and it gradually became the recognized software package management standard for Linux. Vendors that support this format include RedHat linux, suse linux, and Mandriva linux.

The rpm command is very powerful, so what exactly does the rpm command do?

1 Query the information of the rpm package installed in the linux system
2 Query the information of the rpm package installation file
3 Install the rpm package to the current linux system
4 From linux Uninstall the installed rpm software package in the system
5 Upgrade the rpm software package of the current linux system

(1) #rpm -qa without parameters is used to view all rpm packages that have been installed in the system
(2) #rpm -q rpm package name is used to view whether the package is installed in the system , if installed, the system will display the complete package name; if not installed, the system will prompt "package bas is not installed".
(3) #rpm -qi rpm package name is used to view the complete information of the rpm package that has been installed in the system, including the version information of the package, installation time and size, etc.
(4) #rpm -ql rpm package name is used to check where the software package is installed.
(5) #rpm -qf file name is used to check which rpm package a certain file is installed with.
(6) #rpm -qpi rpm package name and #rpm -qpl are used to view information about uninstalled packages. Please note the difference from (4) and (5).
(7) #rpm -ivh The package name is used to install the rpm software package. i represents installation, v represents visual installation, and h represents the progress displayed during installation.
(8) #rpm --force The -irpm package is used to force the installation of rpm packages, and the --force parameter is used to install rpm packages with dependencies. But generally we don't do that. A better way to resolve dependencies is to use the #rpm -i command to install them together.
(9) #rpm -e rpm package name is used to delete rpm packages. rpm -e --nodeps package name is used to delete software packages that have dependencies. This command can delete all software packages that have dependencies on this package.
(10) #rpm -Urpm package name is used to upgrade the rpm package.

The above is the editor's introduction to Linux commands for decompressing rpm packages and an introduction to the use of rpm commands. I hope you like it.

For more linux commands to decompress rpm packages and introduction to the use of rpm commands, please pay attention to the PHP Chinese website for related articles!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn