How to find where a program is installed Linux Ubuntu. This post explains how to find the path of a command in Linux. On Ubuntu, find application path – find where package is installed Ubuntu Linux.
Find Where A Program Is Installed Linux Ubuntu
For where the program was installed (including all of the supporting files, so it can be a long list that you would need to search through)
Command Syntax
dpkg-query -L APPLICATION-NAME
Usage
dpkg-query -L firefox
For the menu item containing the package, look for a file in /usr/share/menu in the output of dpkg-query:
Command Syntax
dpkg-query -L APPLICATION-NAME | grep /usr/share/menu
Usage
dpkg-query -L firefox | grep /usr/share/menu
In that file you should find “section=”. The string after that text should indicate where in the menu system you would find the link to the application.
dpkg is the package manager for Debian. dpkg is a tool to install, build, remove and manage Debian packages. The primary and more user-friendly front-end for dpkg is aptitude. dpkg itself is controlled entirely via command line parameters, which consist of exactly one action and zero or more options. The action-parameter tells dpkg what to do and options control the behavior of the action in some way. dpkg can also be used as a front-end to dpkg-deb and dpkg-query.
You might also try:
Command Syntax
aptitude show APPLICATION-NAME
Usage
aptitude show firefox
How To Find The Path Of A Command In Linux
You can use which and whereis command to find the path of a command in Linux Ubuntu. Using these commands, you can find application path – find where package is installed Ubuntu Linux.
which
which is used to locate a command. which returns the pathnames of the files (or links) which would be executed in the current environment, had its arguments been given as commands in a strictly POSIX-conformant shell. It does this by searching the PATH for executable files matching the names of the arguments. It does not follow symbolic links.
Syntax of the command is:
which [-a] filename
It uses the parameter : -a – this parameter can print all matching pathnames of each argument.
whereis
whereis command is used to locate the binary, source, and manual page files for a command. whereis locates the binary, source and manual files for the specified command names. The supplied names are first stripped of leading pathname components and any (single) trailing extension of the form .ext (for example: .c) Prefixes of s. resulting from use of source code control are also dealt with. whereis then attempts to locate the desired program in the standard Linux places, and in the places specified by $PATH and $MANPATH.
Syntax of the command is:
whereis [options] [-BMS directory... -f] filename
The search restrictions (options -b, -m and -s) are cumulative and apply to the subsequent name patterns on the command line. Any new search restriction resets the search mask. For example:
whereis -bm ls tr -m gcc
searches for “ls” and “tr” binaries and man pages, and for “gcc” man pages only. The options -B, -M and -S reset search paths for the subsequent name patterns. For example:
whereis -m ls -M /usr/share/man/man1 -f cal
searches for “ls” man pages in all default paths, but for “cal” in the /usr/share/man/man1 directory only.
Do not get confused with “find” command. The ‘find’ searches the directory tree rooted at each file name FILE by evaluating the EXPRESSION on each file it finds in the tree. The command line may begin with the ‘-H’, ‘-L’, ‘-P’, ‘-D’ and ‘-O’ options. These are followed by a list of files or directories that should be searched. If no files to search are specified, the current directory (‘.’) is used.
This list of files to search is followed by a list of expressions describing the files we wish to search for.