rpm -qa queries all installed rpm packages, which can be used with the grep command.
rpm -qi Query the introduction of a specific package.
rpm -ql lists all files of a specific package.
- $ rpm -qa | grep java
java-1.7.0-openjdk-1.7.0.91-2.6.2.2.el6_7.x86_64
tzdata-java-2015e-1.el6.noarch
java-1.7.0-openjdk-devel-1.7.0.91-2.6.2.2.el6_7.x86_64
java-1.6.0-openjdk-1.6.0.35-1.13.7.1.el6_6.x86_64
- $ rpm -ql java-1.7.0-openjdk-devel-1.7.0.91-2.6.2.2.el6_7.x86_64
lists all relevant installation directories