List the files installed by the bash package.
Look up paths from the package name.
Which command is appropriate?
rpm -ql PACKAGE lists the files recorded for an installed package. The reverse lookup from a path uses -qf.
Detailed explanation
rpm -ql bashCorrect. rpm -ql bash lists the files owned by the installed bash package.
Correct. rpm -ql bash lists the files owned by the installed bash package.
rpm -qf bashIncorrect. -qf expects a file path and finds its owning package.
Incorrect. -qf expects a file path and finds its owning package.
rpm -qi bashIncorrect. -qi displays package metadata rather than the file list.
Incorrect. -qi displays package metadata rather than the file list.
rpm -V bashIncorrect. -V verifies file attributes against the package database.
Incorrect. -V verifies file attributes against the package database.
Try it yourself
An example you can run in a temporary verification environment.
rpm --help | grep -E -- '--list|-l'Expected result
package queryのlistオプションの説明Key points
- -l lists files
- Pass a package name
- -qf performs the reverse lookup
Notes
- Environment: RPM 4.19〜6.x公式仕様
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.