Get full path of script in PATH environment variable
Solution 1:
You can use which
. From the man page:
The which utility takes a list of command names and searches the path for each executable file that would be run had these commands actually been invoked
Solution 2:
A good alternative to which
is the builtin type
. The advantage being that type
is also able to handle bash aliases and functions.
Solution 3:
which -a [nameofexecutable]
IE:
Macbook-Pro:~ njboot$ which -a chmod
/bin/chmod
Macbook-Pro:~ njboot$ which -a nusers
/Users/njboot/bin/nusers