Sometimes it's useful to find out what rpm owns a given file. In theory, you
could figure out what rpm owns /usr/X11R6/bin/xsnow (pretend you don't
remember) using a shell construction like the following:
# rpm -qa | while read p; do rpm -ql $p | grep -q '^/usr/X11R6/bin/xsnow$' && echo $p; done
xsnow-1.41-1
Since this takes a long time to type, and even longer to run (1m50s on one of our
Pentiums), the rpm developers thoughtfully included the capability in rpm. You
can query for the owner of a given file using rpm -qf:
# rpm -qf /usr/X11R6/bin/xsnow
xsnow-1.41-1
Even on the Pentium, that only takes 0.3s to run. And even fast typists will
enjoy the simplicity of rpm -qf compared to the complex shell construction :)