Can any one please tell me as to what is the exact difference between these two commands

rpm -qa php

rpm -qa | grep php

As far as I know, they both list php related info if only it is installed on the system. Right? The first command gives only php centric info, while the second one displays all the php related packages and dependencies. And it does so with the help of the grep word which is a regular expression search facility built into the os. Right? What are other command that can be used with grep? Are there any consideration to be taken into account when using it with other commands such as cat, ls, ps or yum? Thanks.....