Where does a program install on linux?

Depends on the Linux flavor (distro) that you are running but typically programs get installed on /usr/bin or /usr/local/bin

You can cd to the /usr/bin directory and then do ls -la | more and you'll see all the "executable" files there.


While is true that every distro has it's own methods there is a standard (or attempt for it) filesystem hierarchy which is worth reading:

http://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html

There you'll see where should go the system binaries, the system libraries, why no_system binaries go some times to /usr/bin and some other times to /usr/local/bin, what is /bin, what the heck is /usr/sbin, where should be located the documentation of each package, why settings are placed in /etc, what is the /var directory, why packages which are not from your distro commonly are installed in /opt, etc...

Again, It's worth reading.


There are different methods depending on the linux distribution -- On Redhat/Fedora the the installation is done though RPM packages, which then are distributed for update and installed mostly using YUM -- How to create a RPM is documented here

On debrian/ubutu systems the equivalent is a DEB package which is distributed and installed though apt-get. How to create a DEB package is documented here

If all you want is your own program which you have compiled on your own system yo be accessible for you to execute, then either just setup the PATH to include the directory where your executable is located, or copy the executable to /usr/bin or (/usr/local/bin if that is part of the PATH already)