Updated: 28 September 2026 · Applies to: RPM and dnf on AlmaLinux and Rocky Linux 9 and 10, RHEL 9 and 10, Fedora; dpkg on Ubuntu and Debian

After installing a package you often need to know where it put its files: the program itself, its configuration, its logs or its documentation. The package database knows the exact list. On older CentOS guides this was done with yum; the commands below work on current systems.

Files of an installed package

rpm -ql nginx            # every file
rpm -qc nginx            # configuration files only
rpm -qd nginx            # documentation only
rpm -ql nginx | grep bin/   # the programs

Files of a package that is not installed

dnf repoquery -l nginx

This reads the list from the repository metadata, so you can check before installing.

The other way round: which package owns this file?

rpm -qf /usr/sbin/nginx           # an installed file
dnf provides '*/bin/htpasswd'     # a file you do not have yet

Where is a command?

command -v nginx         # the path your shell would run
type -a python3          # all matches in PATH, and aliases

Where the configuration really lives

The package list shows the default files. The service may be started with a different file, so check the running configuration too, for example systemctl cat nginx for the start command, or nginx -t, which prints the configuration file it tests.

On Ubuntu and Debian

dpkg -L nginx            # files of an installed package
dpkg -S /usr/sbin/nginx  # which package owns a file

For packages that are not installed, install apt-file, run apt-file update, then apt-file list nginx.

Official documentation: RPM documentation and DNF command reference.

Ucartz services for this topic

Was this answer helpful? 0 Users Found This Useful (0 Votes)