How to extract specific files from an RPM (Linux)

As an alternative to installing the entirety of an RPM when you're only interested into some of the files it contains...

rpm2cpio myrpm | cpio -idv *myfilename*


rpm2cpio converts the rpm  "myrpm" into a cpio archive, which is then passed as a parameter of the cpio command, with arguments:

-i : extracts
-d : creates directories as needed
-v : verbose



Only the files with names matching "myfilename" will be extracted.