which my_commad_name
spoilerNAME
which - locate a command
SYNOPSIS
which [-a] filename ...
DESCRIPTION
which returns the pathnames of the files (or links) which would
be executed in the current environment, had its arguments been
given as commands in a strictly POSIX-conformant shell. It does
this by searching the PATH for executable files matching the
names of the arguments. It does not follow symbolic links.
zsh Shell Builtin Command
where my_command_name
spoilerwhere [ -wpmsS ] [ -x num ] name ...
Equivalent to whence -ca.
whence [ -vcwfpamsS ] [ -x num ] name ...
For each name, indicate how it would be interpreted if used as a command name.
If name is not an alias, built-in command, external command, shell function, hashed command, or a reserved word, the exit status shall be non-zero, and — if -v, -c, or -w was passed — a message will be written to standard output. (This is different from other shells that write that message to standard error.)
whence is most useful when name is only the last path component of a command, i.e. does not include a ‘/’; in particular, pattern matching only succeeds if just the non-directory component of the command is passed.