Which command option is used to get a list of files in a package with dpkg?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The command option that allows you to get a list of files in a package with dpkg is indeed the one focused on retrieving the contents of that package. When using dpkg in a Debian-based Linux system, the --contents option (often abbreviated as -c) is specifically designed to display the files installed by a particular package.

This option provides a comprehensive listing of all the files that are part of the package, which can be particularly useful for understanding what components are included and where they are located within the system. For instance, if you have a package named example-package, you can use the command dpkg -c example-package.deb to see all of its files.

The other options represent different functionalities of the dpkg command. While --info provides metadata about the package, such as its version and description, --listfiles and --files are not valid options for this specific command. As a result, the --contents option stands out as the correct answer for listing the files contained within a package.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy