List the files installed by the bash package.
Read the local package database rather than the contents of a deb archive.
Which command is appropriate?
dpkg -L PACKAGE lists the paths recorded for an installed package in the local package database.
Detailed explanation
dpkg -S bashIncorrect. -S searches which installed package owns a path.
Incorrect. -S searches which installed package owns a path.
dpkg -s bashIncorrect. -s displays package status and metadata.
Incorrect. -s displays package status and metadata.
dpkg -I bashIncorrect. -I inspects a deb archive's metadata.
Incorrect. -I inspects a deb archive's metadata.
dpkg -L bashCorrect. dpkg -L bash lists paths belonging to the installed bash package.
Correct. dpkg -L bash lists paths belonging to the installed bash package.
Try it yourself
An example you can run in a temporary verification environment.
dpkg -L bash | headExpected result
bashパッケージが配置したファイルパスの先頭部分Key points
- -L lists package files
- The argument is a package name
- -S performs the reverse lookup
Notes
- Environment: Debian系 / dpkg-query
- 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.