Possible Duplicate:
Location of file folders of installed programs
For example the following are the same
# /usr/bin/php updateDatabase.php
# php updateDatabase.php
But how would I infer the location of the php command to be in /usr/bin?
Possible Duplicate:
Location of file folders of installed programs
For example the following are the same
# /usr/bin/php updateDatabase.php
# php updateDatabase.php
But how would I infer the location of the php command to be in /usr/bin?
You can use the whereis
command to find the location of an executable binary on your system.
Example:
$ whereis ls
ls: /bin/ls /usr/share/man/man1/ls.1.gz
EDIT: From this answer to a similar question, you can also use the which
command.
Example:
$ which ls
/bin/ls
whereis ts-node
only returns 'ts-node:' which isn't the location.
Apr 8, 2022 at 20:02
When the program can be run without specifying the full path, then its directory is in your $PATH
variable.
Run
$ echo $PATH
/home/cweiske/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games