How to find the installation path for a software under linux?
Under linux, I launch a software by typing, e.g., fluidplot. How can I find the installation path for this software?
9 Answers 9
to see where it is executing from (if it’s in your $PATH). Or:
find / -name fluidpoint 2> /dev/null
to look for a file named fluipoint and redirect errors on virtual filesystems.
Usually they are in /sbin , /usr/sbin , /usr/local/bin or ~ as a hidden directory.
NAME which - shows the full path of (shell) commands. SYNOPSIS which [options] [--] programname [. ]
@Michael excellent to know. Because of your comment, I just discovered that newer versions of bash also do this. +1 to your comment.
The «Usually they are . » line is pretty disingenuous, additional software should be in /opt/* or /usr/local/bin . ~ is your home directory, I’m confused why you call it «hidden».
Sorry to be ambiguous, I mean ~/.dir . The hidden directory is below the home directory. And I completely forgot about /usr/local/bin dop.
If you use an RPM based distribution (CentOS, RHEL, SUSE, openSUSE) you can use rpm -ql
rpm -ql findutils /bin/find /usr/bin/find /usr/bin/xargs /usr/share/doc/packages/findutils /usr/share/doc/packages/findutils/AUTHORS /usr/share/doc/packages/findutils/COPYING /usr/share/doc/packages/findutils/NEWS /usr/share/doc/packages/findutils/README /usr/share/doc/packages/findutils/THANKS /usr/share/doc/packages/findutils/TODO /usr/share/info/find.info.gz /usr/share/man/man1/find.1.gz
Things aren’t installed to locations in the Linux/UNIX world like they are in the Windows (and even somewhat in the Mac) world. They are more distributed. Binaries are in /bin or /sbin , libraries are in /lib , icons/graphics/docs are in /share, configuration is in /etc and program data is in /var .
The /bin , /lib , /sbin contain the core applications needed for booting and the /usr contains all the other user and system applications.
Just to add some point to @djsumdog’s answer, if you are using DPKG based dist, like Ubuntu, you can use
to check what it is about, and
dpkg --listfiles some_package
to check what files are included/relevant to this package. It’s for packages that don’t have a binary to run, like libnss3 . And
to find what package includes this file.
For example, dpkg —listfiles libnss3 gives me:
/. /usr /usr/lib /usr/lib/i386-linux-gnu /usr/lib/i386-linux-gnu/libssl3.so /usr/lib/i386-linux-gnu/nss /usr/lib/i386-linux-gnu/nss/libsoftokn3.chk /usr/lib/i386-linux-gnu/nss/libnssckbi.so /usr/lib/i386-linux-gnu/nss/libnsssysinit.so /usr/lib/i386-linux-gnu/nss/libfreebl3.chk /usr/lib/i386-linux-gnu/nss/libnssdbm3.chk /usr/lib/i386-linux-gnu/nss/libnssdbm3.so /usr/lib/i386-linux-gnu/nss/libsoftokn3.so /usr/lib/i386-linux-gnu/nss/libfreebl3.so /usr/lib/i386-linux-gnu/libnssutil3.so /usr/lib/i386-linux-gnu/libsmime3.so /usr/lib/i386-linux-gnu/libnss3.so /usr/share /usr/share/doc /usr/share/doc/libnss3 /usr/share/doc/libnss3/copyright /usr/share/doc/libnss3/changelog.Debian.gz /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/libnss3
Note that the folders are not only owned by this packages, but by others too. Just check the files.
And reversely, dpkg —search libnss3.so gives me:
firefox: /usr/lib/firefox/libnss3.so thunderbird: /usr/lib/thunderbird/libnss3.so libnss3:i386: /usr/lib/i386-linux-gnu/libnss3.so libnss3-1d:i386: /usr/lib/i386-linux-gnu/libnss3.so.1d
How can i find the location of installed software in linux?
Is there any command that I can use in the console to know the location of installed software in linux? i have copied a xyz.bin from windows machine to linuxdesktop and installed it. more over can you please tell me how to uninstall a software which is installed in linux Thanks in advance
You might be able to use the find command to search for it. Have a look at this unix.stackexchange.com/questions/19369/…
3 Answers 3
to find the path where the binary is linked to.
Other application specific files may reside in
The way a package is installed/uninstalled on Linux depends on either the specific Linux distribution AND the specific package.
Since you have used a .bin file for installation, it is likely that you have an uninstall command specific for your program in the path.
If you provide more information about the package and the Linux distribution, we can give more help.
It depends on the distribution you’re using. Supposing you are using a debian\ubuntu distribution, you can uninstall it by the apt command, using sudo apt-get remove software_name sudo apt-get purge software_name
Of course you need to have root privileges.
The softwares are usually installed in bin folders, in /usr/bin, /home/user/bin and many other places, a nice starting point could be the find command to find the executable name, but it’s usually not a single folder. The software could have components and dependencies in lib,bin and other folders.
How do I find where an application is installed?
I installed wireshark recently. I have no idea in which directory it was installed, but it’s not in /opt . How do I find where it’s installed?
5 Answers 5
Assuming you installed it from the repos:
$ dpkg -L wireshark wireshark-common /. /usr /usr/bin /usr/bin/wireshark /usr/share /usr/share/menu /usr/share/menu/wireshark /usr/share/pixmaps /usr/share/pixmaps/wsicon32.xpm /usr/share/applications /usr/share/applications/wireshark.desktop /usr/share/doc /usr/share/doc/wireshark /usr/share/doc/wireshark/copyright /usr/share/icons /usr/share/icons/hicolor /usr/share/icons/hicolor/48x48 /usr/share/icons/hicolor/48x48/apps /usr/share/icons/hicolor/48x48/apps/wireshark.png /usr/share/icons/hicolor/scalable /usr/share/icons/hicolor/scalable/apps /usr/share/icons/hicolor/scalable/apps/wireshark.svg /usr/share/man /usr/share/man/man1 /usr/share/man/man1/wireshark.1.gz /usr/share/doc/wireshark/changelog.Debian.gz /usr/share/doc/wireshark/README.Debian /. /usr /usr/bin /usr/bin/editcap /usr/bin/text2pcap /usr/bin/dumpcap /usr/bin/rawshark /usr/bin/mergecap /usr/bin/capinfos /usr/share /usr/share/doc /usr/share/doc/wireshark-common /usr/share/doc/wireshark-common/README.Debian /usr/share/doc/wireshark-common/copyright /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/wireshark-common /usr/share/man /usr/share/man/man4 /usr/share/man/man4/wireshark-filter.4.gz /usr/share/man/man1 /usr/share/man/man1/mergecap.1.gz /usr/share/man/man1/capinfos.1.gz /usr/share/man/man1/dumpcap.1.gz /usr/share/man/man1/editcap.1.gz /usr/share/man/man1/text2pcap.1.gz /usr/share/man/man1/rawshark.1.gz /usr/share/doc/wireshark-common/changelog.Debian.gz
which wireshark will lead you to the executable. The output could ressemble this :
$ which wireshark /usr/bin/wireshark
Software never gets installed into /opt unless you yourself do that.
it only works in this particular case. what if I was to install «my super program», how would I find its path?
@AlanDert why would it not work? 🙂 which checks the current environment so it will find it if you can execute it.
Some packages do install in /opt , though none in the main repositories do this. Examples: Google Chrome, Adobe Reader (Canonical partner repository), Spotify, etc. Please also note that it is even an requirement to install in /opt for MyApps (extras.ubuntu.com). developer.ubuntu.com/publish/my-apps-packages
This answer is mostly wrong. which program-name returns the path to the executable, which can be completely different from the install location of a program(e.g. there is /usr/bin/inkscape but the installation is in /usr/share/inkscape ). They are identical iff the program is a single executable without any need for system-wide resources/extensions/configurations.
I would recommend going with @Oli’s answer, if that works for you. For applications that you (for whatever reason) didn’t install with the
You can examine the unity launcher icon, it may be able to tell you:
The launcher file will usually be located in /usr/share/applications/ , and named something like my-application-launcher.desktop . If you don’t know exactly what the file is called, use ls to examine the directory. (For your specific one, it is called wireshark.desktop .)
Once you know which one it is, examine its contents (anything from cat to gedit will work, but if you use gedit make sure to do it as gksu gksu gedit , not sudo gedit ).
The file will contain an entry with something like Exec=command or Exec=/path/to/script.sh . If it only has a command, you can use which or locate (like @Rinzwind said) to get the full path for it. Another option is to use whereis to find the binary or source location.
The directory containing the launcher’s target should be the installation directory for the program. If the launcher points to a shell script, sometimes examining its contents can reveal additional locations, if needed.
Running gksu nautilus when you get there will give you a windowed file browser with root permissions, meaning you can use it to copy/delete/edit any file, since normally installations are protected and will prevent you from modifying files as a normal user.
If that doesn’t work, another option is to use find , to find anything with the same name, or grep , to find files containing the name.
However, you should only do this if you don’t have any better alternatives. This can be a slow, tedious, mind-numbing process, especially since sometimes there is more than one location that stuff is installed to. If you can, use some other method.
Find installation path in linux [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
services are automatically installed. How to find exact path where any service is installed and their configuration files??
3 Answers 3
There are quite a few ways to find this but I usually prefer following
and to find from which path program is using, I use
If you’re using apt-get , install apt-file program and you can list the contents of the package:
sudo apt-file update apt-file list package_name
This will show all the files that will be installed by a package, binaries, configuration files, systemd startup files, etc.
If you use yum , install yum-utils and use repoquery :
Suppose service name is nginx then you can find it in /etc/nginx/ on ubuntu .
On centos you can check path using commands given by slashRahul. As per my knowledge you can not change installation path while installing by apt-get. Software components are not installed in a single directory, but across many folders like binaries stay in /usr/bin/, /bin, /sbin, Configuration in other directories.