which – Locate a program file in the user’s path

Syntax

which [option] {command} ...

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.

Options

-a
List all instances of executables found (instead of just the first one of each).
-s
Run silenty. It returns the value 0 if all of the executables are found, or 1 if at least one was not found.

Further information

man which


2026-01-02