The unix command "which" is commonly used to search for an executable in the PATH, even though it is not very good at this job.
which
is a shell command that searches for an executable in the command search path ($PATH
— see path) by name. Use this tag for questions about the which
utility and about other commands that perform a similar function.
which
has many pitfalls. It is usually more reliable to use command -v
or type
instead.