How to find program name(s) of an installed package?

The locations of files (executables, man-pages and other stuff) should conform Filesystem Hierarchy Standard as a rule.

Personally I solve this problem with one of four methods:

  1. It is known that executables are placed in the directories declared in $PATH environment variable:

    $ echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

    So one can list all package files with dpkg --list (see man dpkg for details) and find files in /bin, /sbin, /usr/bin, /usr/sbin, /usr/games directories. So we can use the following command:

    $ dpkg -L httpcode | grep -E "/bin/|/sbin/|/usr/games/"
    /usr/bin/hc
    

    So we can see that /usr/bin/hc belongs to this package.

  2. List all man-pages:

    $ dpkg -L httpcode | grep "/man/"
    /usr/share/man/man1
    /usr/share/man/man1/hc.1.gz
    

    So we can see that we can use man hc.

  3. For applications with GUI I run search for *.desktop files.

    $ dpkg -L httpcode | grep ".desktop"
    $
    

    In this particular case it will not return anything.

    With some complicated proprietary (or bad-packaged) stuff this method transforms to reading Exec variable in the *.desktop file - here Telegram is an example:

     $ dpkg -L telegram | grep ".desktop"
    /usr/share/applications/telegram.desktop
    
    $ grep Exec $(dpkg -L telegram | grep ".desktop")
    Exec=/opt/telegram/Telegram -- %u
    

    About Exec see Desktop Entry Specification.

  4. For not installed package one can visit https://packages.ubuntu.com and use Search package directories here (for all releases or for selected release), then click on list of files link in the right column of the table:

    list of files link

    and one will get the file list:

    list of files for httpcode package

    This list may interpreted manually or by using searchbar in the browser.