How To Tell Which RPM Package A Command Comes From

Use the which command to find which executable runs when you enter the command.
[jack@jf ~]$ which gimp
/usr/bin/gimp
		
Now use the rpm -qf <file> command to search the rpm database to find which package that file belongs to.
[jack@jf ~]$ rpm -qf /usr/bin/gimp
gimp-2.3.14-3.3mdv2007.1