How to find the executable file of an app if 'whereis' is not showing it?
Solution 1
You can use apt-file search <package-name>
or dpkg -S <package-name>
, where <package-name>
is the package you want to search.
Note that these commands will output many results. To find the required package use grep
:
apt-file search package | grep -E "(bin/)?package$"
OR
dpkg -S package | grep -E "(bin/)?package$"
This searches the lines whose last word is package
and may or may not be preceded by bin/
, for example it will result both /usr/bin/package
and /usr/anydirectory/package
.
Solution 2
Some other commands which (similar to the whereis
) can tell you where the executable is (all of them detailed in answers to this question) are summarized here:
Solution 3
Another quick way to find executable programs is to use locate
, which will only show those programs present on your computer. It relies on a database that is automatically updated by cron
every day. (Use sudo updatedb
to refresh it manually if you have just installed some programs and cannot find them when using locate
.)
If, for example, you wanted to find where the dosbox executable is, simply type:
locate dosbox | grep bin
Which returns,
/usr/bin/dosbox
Apart from using whereis
, this is the quickest way to find executables. It can also be used to find readme documents extremely quickly by substituting bin
for README
.
Locate is a very useful program and you can even use regex with it if you want to conduct more complex searches. See man locate
for more details.
Related videos on Youtube
Nirmik
A true LINUX lover and APPLE fan!! An aspiring OS DEVELOPER i love to work on linux. :) With an encounter with linux from the past 1year,I have definitely succeded in creating a LINUX community around with many friends. Love LINUX for every bit of it..!! :) <3
Updated on September 18, 2022Comments
-
Nirmik over 1 year
This basically to do with cuttlefish(The app from showdown) in this case.
I cant find the location of the executable file for it.
The command
whereis
did not give any results!I want to add it to my start up applications and thus i need the path!
P.S: the preferences of the app are not showing up and ticking against the start automatically thing when the settings for the 1st time showed up is not working!.
So i need to find out the executable/bin file...
How do i do this?
-
nanofarad almost 12 yearsMaybe you could instruct the OP to use grep to filter results?
-
Nirmik almost 12 yearscan you take a look and help me with which from these is the one?-paste.ubuntu.com/1151045
-
Nirmik almost 12 yearsand the 1st command just gave me this-
nirmik@xxxxxxxxxx:~$ apt-cache search cuttlefish cuttlefish - A simple reactive tool
-
Eliah Kagan almost 12 yearsIndeed,
apt-cache search
does not report where the executable (or any files) from the package is (or would be) installed. -
Nirmik almost 12 years@EliahKagan...could you help me with the pastebin output?
-
green almost 12 yearscorrected the answer.
-
Nirmik almost 12 yearsoutput of the dpkg command -paste.ubuntu.com/1151102 which one?
-
Nirmik almost 12 yearsfound it! phew! thanx! :)