Context:
I'm trying to make an application automatically start when I login. For this I need to select the path
for the application.
Here are the paths I already looked into:
/sbin
/usr/sbin
/usr/local/bin
/usr/share/
If this may help, the application I'm trying to find is called "ScreenCloud" and I downloaded it from the Ubuntu Software Center.
But I cannot find it, is there any way I can know where is installed a particular software? Because even if I found for this one, I would like to avoid having the same issue in the future.
Find the path of an executable
Best way
type executable
Check out this question to learn more about how
type
is better. (Thanks, comments!)Other ways
whereis executable
which executable
Those commands only search in the PATH variable (
echo $PATH
), thus they are not valid in some cases (built-in functions, aliases, or bash functions, and more).Find command location inside or outside of path
Assume you want to find the location of
uname
, a program that lists system information. If you want to know what directory the top level command is stored in you have a number of options:Locate advantages
The last option
locate
returns all files containinguname
not just the program that is run from the command prompt.The advantage of
locate
is it will find commands not in your search path.type -a
(preferred over simpletype
) andwhich
will only find commands in your search path. To see your search path useecho $PATH
.Take for example this answer in How to start screencloud? :
The
locate screencloud
command will find it butwhich screencloud
andtype -a screencloud
will not because:screencloud.sh
and onlylocate
command searches on partial match./opt/screencloud
probably isn't in the search path.which
andtype
only look for executable files in search path.Note: This is an older answer. Modern ScreenCloud is called with
screencloud
.Locate's advantage over the
find
command is it can be hundreds or even thousands of times faster. Also runningfind
starting from/
will give many permission errors you won't experience withlocate
.Locate disadvantages
If you just installed the program today you will need to use
sudo updatedb
to update locate's database.Use the following command to list all of your
$PATH
directories:Use the following command to find the full path for
screencloud
:If you used
apt
,apt-get
, or the Ubuntu Software Center to install the package, you can use the following command to find the full path:Assuming you used this repository, you should be able to find
screencloud
in/usr/bin/
.The full path is:
or
However, if you used the snapcraft store according to the link you provided in your question, then the path would be under the following directory:
more info
Also, please remember that Ubuntu is case sensitive so you must use all lowercase with no capital letters.