Rpm-qf
QUERY OPTIONS
The general form of a RPM query command is
RPM {-q|--query} [select-options] [query-options]
Package SELECTION OPTIONS:
-F,--file file
Query package owning file. (check which package owns file)
RPM-QF [FileName]
It is possible to query which installation package the filename was installed on, which is undoubtedly a boon for the students who want to query the source code, and some tools in Linux have no connection to tool name at all.
For example, if you want to check the source code of Ping, search the source code of Ping on the Internet, or find it on the RPM download website, it will be useful for the tool.
Rpm-qf ' which ping '
[[Email protected] Desktop]# which ping
/bin/ping
[[Email protected] Desktop]# rpm-qf ' which ping '
iputils-20071127-17.el6_4.2.i686
With this combination, it's easy to find the source code
Another magical feature of this command is also mentioned in this blog post.
Http://blog.sina.com.cn/s/blog_6fb8aaeb0100wvw8.html
The Magical magic of rpm