CompTIA Linux+ (XK0-005) — Question 153
A developer reported an incident involving the application configuration file /etc/httpd/conf/httpd.conf that is missing from the server. Which of the following identifies the RPM package that installed the configuration file?
Answer options
- A. rpm -qf /etc/httpd/conf/httpd.conf
- B. rpm -ql /etc/httpd/conf/httpd.conf
- C. rpm --query /etc/httpd/conf/httpd.conf
- D. rpm -q /etc/httpd/conf/httpd.conf
Correct answer: A
Explanation
The correct command is 'rpm -qf /etc/httpd/conf/httpd.conf', which queries the RPM database to find out which package installed the specified file. The other options either list files belonging to a package ('-ql') or do not provide the necessary format for querying the file's package ('--query' and '-q' without the 'f' flag), making them incorrect for this specific requirement.