List the paths contained in nginx, even if it is not installed.
Start from the package name rather than reverse-looking up a path.
Which command is appropriate?
apt-file list PACKAGE lists paths supplied by a package from Contents indexes. apt-file search works in the opposite direction.
Detailed explanation
apt-file search nginxIncorrect. search looks for matching paths and does not limit results to nginx's complete file list.
Incorrect. search looks for matching paths and does not limit results to nginx's complete file list.
apt-cache show nginxIncorrect. apt-cache show displays metadata, not the file list.
Incorrect. apt-cache show displays metadata, not the file list.
apt-file list nginxCorrect. apt-file list nginx lists paths supplied by nginx.
Correct. apt-file list nginx lists paths supplied by nginx.
apt-cache policy nginxIncorrect. policy displays version and source priority information.
Incorrect. policy displays version and source priority information.
Try it yourself
An example you can run in a temporary verification environment.
apt-file list nginx | sed -n '1,5p'Expected result
nginx: で始まる収録ファイルパス。apt-fileとContents索引が必要Key points
- list maps package to files
- search maps path to package
- Uninstalled packages can be queried
Notes
- Environment: apt-file 3.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.