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 section 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 the rpm command (a combination of the –q, –d, and –i options):
# rpm -qdi grep
Name : grep Relocations: /usr
Version : 2.5.1 Vendor: Red Hat,
Inc.
Release : 4 Build Date: Sat 20 Jul
2002 01:08:48 AM CDT
Install date: Sat 05 Oct 2002 12:21:58 PM CDT Build
Host: stripples.devel.redhat.com
Group : Applications/Text Source RPM: grep-2.5.1-
4.src.rpm
Size : 475770 License: GPL
Signature : DSA/SHA1, Tue 03 Sep 2002 04:17:47 PM CDT, Key ID
219180cddb42a60ePackager : Red Hat, Inc.
<http://bugzilla.redhat.com/bugzilla>
Summary : The GNU versions of grep 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.
You should install grep on your system, because it is a very useful
utility for searching text.
/usr/share/doc/grep-2.5.1/ABOUT-NLS
/usr/share/doc/grep-2.5.1/AUTHORS
/usr/share/doc/grep-2.5.1/ChangeLog
/usr/share/doc/grep-2.5.1/NEWS
/usr/share/doc/grep-2.5.1/README
/usr/share/doc/grep-2.5.1/THANKS
/usr/share/doc/grep-2.5.1/TODO
/usr/share/info/grep.info-1.gz
/usr/share/info/grep.info-2.gz
/usr/share/info/grep.info-3.gz
/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's often hard 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.