You want to install some hot new program on Debian or Ubuntu. You find the package and use apt to install it. But when you attempt to run it on the command line, you get an error message from the shell saying, “Command not found.” Here’s how to find out where apt installed it.
You Just Installed That Package, but What’s the Command to Run It?
Most of the time, the name of the executable program corresponds with the name of the Debian or Ubuntu package. Sometimes, they’re different and you have to do a little work to figure out the executable’s name. Often, this is because the package name conflicts with an existing package. Fortunately, it only takes one command to figure out the program’s name.
Using dpkg to List Installed Files
To list the full pathnames of the installed files of a package, simply use the-L (capital L)option with the dpkg command. For example, to examine Firefox ESR:
You’ll see the paths of each file the package installed, including the oh-so-important executable:

Where Are Executable Programs in Linux?
The executable you’re looking for is typically in abindirectory which stands for “binary”. Inthe Linux directory structure, /usr/bin is the primary location for executables you install:
Your shell uses a search path to look for programs in these directories when you enter a command. To see the directories in your search path, examine the$PATH environment variable:

You’ll see the directories in your search path separated by a colon(:)character. Debian and Ubuntu typically install new programs in the/usr/binor/usr/sbindirectories. The latter are typically system administration programs that require you to run as root using sudo.
Now You Know Where apt Installed That Program
With a quick dpkg command and knowledge of Linux directory organization, it’s easy to figure out where apt installed your brand-new program. This process is especially useful when the name of a program doesn’t match the package name. You can also use theApt Search Command to search for a package in Ubuntu.