Product SiteDocumentation Site

4.2.9. Combining queries

The rpm command is very flexible in allowing you to combine queries. Just start the command with rpm –q and add the various options either on their own, such as –q with –s and –f, or together, such as –qsf.
The following sections show a few handy combinations of the options you can use for real-world package-management tasks.

4.2.9.1. Listing Package Description and Documentation Files

To find information on a package and where it is documented, use the –qdi option to rpm (a combination of the –q, –d, and –i options):
rpm -qdi grep
Name        : grep                         Relocations: (not relocatable)
Version     : 2.6.3                             Vendor: Fedora Project
Release     : 1.fc13                        Build Date: Wed 07 Apr 2010 05:58:58 PM EDT
Install Date: Fri 27 Aug 2010 07:03:07 PM EDT      Build Host: x86-06.phx2.fedoraproject.org
Group       : Applications/Text             Source RPM: grep-2.6.3-1.fc13.src.rpm
Size        : 800493                           License: GPLv3+
Signature   : RSA/SHA256, Wed 07 Apr 2010 06:48:20 PM EDT, Key ID 7edc6ad6e8e40fde
Packager    : Fedora Project
URL         : http://www.gnu.org/software/grep/
Summary     : Pattern matching utilities
Description :
The GNU versions of commonly used grep utilities. Grep searches through
textual input for lines which contain a match to a specified pattern and then
prints the matching lines. GNU's grep utilities include grep, egrep and fgrep.

GNU grep is needed by many scripts, so it shall be installed on every system.
/usr/share/doc/grep-2.6.3/ABOUT-NLS
/usr/share/doc/grep-2.6.3/AUTHORS
/usr/share/doc/grep-2.6.3/COPYING
/usr/share/doc/grep-2.6.3/ChangeLog
/usr/share/doc/grep-2.6.3/NEWS
/usr/share/doc/grep-2.6.3/README
/usr/share/doc/grep-2.6.3/THANKS
/usr/share/doc/grep-2.6.3/TODO
/usr/share/info/grep.info.gz
/usr/share/man/man1/egrep.1.gz
/usr/share/man/man1/fgrep.1.gz
/usr/share/man/man1/grep.1.gz
It can sometimes be difficult to track down the documentation for a given package. Some packages use Unix manual pages; others use info files, and still others provide HTML for other formatted manuals. Some have no real documentation at all.