How to check the package according to the command in CentOS

Time:2019-11-21

In our work, we often encounter that we want to use a command machine that is not installed, but we don’t know which package the command is in (source compilation is not covered in this article). Here is a rather stupid method to help us solve this problem.

Explain:Blue = command name

Light green = command parameters

Light blue = option

Purple = catalog

System environment: CentOS 6.2 i686

Execute on the machine with the command: Yum supplies * / bin / SAR (change the command path to the command you want to find)

It can be seen from the results that sysstat-9.0.4-18.el6.i686 is the package we are looking for, and then we can use yuminstall sysstat directly on the machine that wants to use SAR.