Find Installed Packages on Ubuntu - How To

Locating Installed Package Files with dpkg
After installing a package using the apt-get utility, it can sometimes seem as though the files have vanished. While the installation is successful, determining the installation location can be challenging.
If you know the name of the executable file, the which command can reveal the binary's location. However, this doesn't provide details about where any associated supporting files are stored.
Fortunately, there's a straightforward method to view the locations of all files installed as part of a specific package, utilizing the dpkg utility.
dpkg -L
Example Usage
Consider a scenario where you've installed davfs2, but are unsure of the configuration file's location. You can use the following command to find out:
geek@ubuntuServ:~$ dpkg -L davfs2
davfs2: /usr/share/lintian/overrides/davfs2
davfs2: /usr/share/davfs2/GPL
davfs2: /usr/share/doc/davfs2/BUGS
davfs2: /usr/share/doc/davfs2/copyright
davfs2: /usr/share/davfs2/NEWS
davfs2: /usr/share/doc/davfs2/THANKS
davfs2: /usr/share/doc/davfs2/NEWS.gz
davfs2: /usr/share/doc/davfs2/README.gz
davfs2: /usr/share/doc/davfs2
davfs2: /usr/share/doc/davfs2/TODO
davfs2: /etc/davfs2/secrets
davfs2: /usr/share/davfs2/THANKS
davfs2: /usr/share/doc/davfs2/README.Debian
davfs2: /usr/share/davfs2/BUGS
davfs2: /etc/davfs2/davfs2.conf
davfs2: /usr/share/davfs2/ChangeLog
davfs2: /usr/share/davfs2/FAQ
davfs2: /etc/davfs2
davfs2: /usr/share/doc/davfs2/changelog.Debian.gz
davfs2: /usr/share/davfs2/secrets.template
davfs2: /usr/share/doc/davfs2/changelog.gz
davfs2: /usr/share/davfs2/TODO
davfs2: /usr/share/davfs2/davfs2.conf.template
davfs2: /usr/share/davfs2/README
davfs2: /usr/share/davfs2
davfs2: /usr/share/doc/davfs2/FAQ
This output clearly indicates that the configuration file is located at /etc/davfs2/davfs2.conf.
Filtering the Output
To narrow down the results and view only files installed into a specific directory, such as /etc, you can pipe the output of dpkg -L to the grep command.
geek@ubuntuServ:~$ dpkg -L davfs2 | grep etc
davfs2: /etc/davfs2/secrets
davfs2: /etc/davfs2/davfs2.conf
davfs2: /etc/davfs2
This provides a more concise and easily readable list of files within the specified directory.
Note: This information was updated based on a helpful suggestion from sebest, changing the command from -S to -L for improved functionality.