Linux Which Command

Sometimes in linux you need to know if you have a program/utility installed and maybe even where it is installed. Since homebrew installs programs in a different place than a global installation. The which command in linux can quickly tell you if a program is installed and where.

The which command knows where to search for the executable program by what is specified with the PATH environment variable.

We can check if we have an application:

> which top
/usr/bin/top

# we installed jq via homebrew so it is a different place
> which jq
/usr/local/bin/jq

# there is no linux utility named dev-diaries (yet!) so this won't show anything
> which dev-diaries
dev-diaries not found

Read more about it here

Instagram Post