I am calling an 'executable' on Linux. One way by console and another from a PHP script. They both call other executables (I see it by the version of the file). So I need a way to display a path to the executable that will be called when I try to run it. How do I do this on Linux?
You can use
For example
You can also get the full path with
The
:
separate the paths that are used, in order or preference.Note that the PATH can be different between users, so if your PHP script is executed with the
www-data
user for example, you have to check the PATH set forwww-data
. In general, it might be safer to specify the full path to the executable when you need to use a specific version of a program.In Bash, use
type -a command
.You can use
or
to see where the binaries or located.