How to list all files installed by the DEB package on Ubuntu/Debian Linux

The typical question after we install a new package on our system is that what are the actual files ware installed and what is their location. This may be even less obvious if the final executable name intended to start your program has slightly different name than the package its self. In the following example we are going to install a dummy package hello using apt-get command:

# apt-get install hello
...
(Reading database ... 7528 files and directories currently installed.)
Preparing to unpack .../hello_2.9-2+deb8u1_amd64.deb ...
Unpacking hello (2.9-2+deb8u1) ...
Setting up hello (2.9-2+deb8u1) ...

From the above package installation output we are unable to see what specific files were installed on our system. The following linux commands will help you determine a list of all files installed by the hello DEB package. Please note that the package must be installed, otherwise both commands will produce no output:

# dpkg --listfiles hello

The above command will list all files deployed and directories created during the installation of hello package. Where, the next command will list only files and their locations:

# dpkg -S hello