Detailed explanation of common commands in Centos

rpm

rpm, Redhat Package Manager, is a special package manager developed by Red Hat for RHEL

Detailed parameter explanation

rpm query whether to install the command

rpm -q 包名字

Options:
-q query (query)
-a all (all)

Query rpm package details command

rpm -qi

Options:
-i query software information
-p query not installed package information

Query the file installation location command in the rpm package

 rpm -ql 包名

Options:
-l list
-p query information about packages not installed

Query which rpm package the system file belongs to

rpm -qf 系统文件名

Options:
-f Query which package the system file belongs to

Query dependency command of rpm package

rpm -qR 包名

Options:
-R query package dependencies
-P query not installed package information

grep command

grep, global search regular expression(RE) and print out the line, fully search for regular expression and print out the line
Options :
-a Do not ignore binary data.
-A <display_columns> In addition to showing the line that conforms to the template style, and display the content after that line.
-b Displays the contents of the line before the line that matches the template style.
-c Count the number of columns conforming to the template style.
-C <display_columns> or -<display_columns> In addition to displaying the column that conforms to the template style, and display the content before and after the column.
-d <action> This parameter must be used when specifying that the directory to be searched is not a file, otherwise the grep command will report information and stop the action.
-e <template style> Specifies the string as the template style to look for the contents of the file.
-E Use the template style as extended normal notation, which means that extended regular expressions can be used.
-f <template file> Specify a template file, whose content has one or more template styles, let grep find the file content that meets the template conditions, and the format is the template style of each column.
-F Treat template styles as a list of fixed strings.
-G Use template styles as normal notation.
-h Do not indicate the name of the file to which the column belongs before displaying the column that conforms to the template style.
-H Before displaying the row that conforms to the template style, mark the file name of the row.
-i Ignore differences in character case.
-l List file names whose contents conform to the specified template style.
-L List file names whose contents do not conform to the specified template style.
-n Indicates the column number before displaying the column that conforms to the template style.
-q Do not display any information.
-R/-r This parameter has the same effect as specifying the "-d recurse" parameter.
-s Do not display error messages.
-v Reverse lookup.
-w Show only whole-word columns.
-x Show only columns that match all columns.
-y This parameter has the same effect as "-i".
-o Output only the matched part of the file.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324816454&siteId=291194637