How to find the Path of an Installed Program in Ubuntu

Back in my FreeBSD days I relied heavily on the locate command to find out where things were installed. Since switching to Debian based Linux I’ve found that command to be far less reliable. The reason for this is it relies on a database that is almost always out of date. Now this is also true for FreeBSD however I never had any issues locating files with it, which makes me wonder if they automatically called it after installing apps through ports or if it ran periodically via a cron job. So you may ask yourself, why am I not recommending this approach? The first is that it’s slow, it takes time to update this database so running updatedb before each locate command will eat up a good 30 seconds or more (you could schedule it with cron though). The second is that it is a security risk which exposes file locations to any non root user. Well then, what do I recommend instead?

dpkg -L program

This will work with any program installed with apt-get, synaptic or dpkg. It is almost much faster and secure — it will only expose installed programs and not personal files. So let’s see an example of it’s output:

Just by skimming over this I can see that the program has documentation in /usr/share/doc/eggdrop and the binary is in /usr/bin/eggdrop and lastly there are libraries in /usr/lib/eggdrop. Of course parsing this mentally requires some knowledge of the Linux file structure, but even without you should still be able to find what you need by looking in those folders.