Questions: Which of the following commands can be used to list the files contained within an installed RPM package?
a. rpm -qa packagename
b. rpm -qi packagename
c. rpm -ql packagename
d. rpm -q packagename
Transcript text: Which of the following commands can be used to list the files contained within an installed RPM package?
a. rpm -qa packagename
b. rpm -qi packagename
c. rpm -ql packagename
d. rpm -q packagename
Solution
The answer is the third one (c): rpm -ql packagename
Explanation for each option:
a. rpm -qa packagename: This command is used to query all installed packages. It does not list the files contained within a specific package.
b. rpm -qi packagename: This command provides detailed information about the specified package, such as its description, version, and other metadata, but it does not list the files contained within the package.
c. rpm -ql packagename: This command lists all the files contained within the specified installed RPM package. It is the correct command for the task described in the question.
d. rpm -q packagename: This command queries the package database to check if the specified package is installed, but it does not list the files contained within the package.
In summary, the correct command to list the files contained within an installed RPM package is rpm -ql packagename.