DELAPARRA
Index
Color
NL
Category: CLI commands

which

Explained by Updated

What is which?

which: Which — Show the full path of a command executable. which shows the full path of the program that runs when you type a command. which php might return /usr/bin/php or /opt/homebrew/bin/php. That helps when several versions are installed, which is common with PHP, Node and Python. If php -v shows a different version than you expect, which php tells you which one your shell actually finds first on the PATH.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about which

What should you keep in mind with which?

which -a php lists every match, in the order they are searched. type php in Bash also reports aliases and shell functions, which which may miss. If the wrong version is picked up, adjust the order of folders in your PATH, or use a version manager like nvm, phpbrew or asdf, which switch versions per project.

At a glance

CategoryCLI commands
Explained by
Updated

More CLI commands terms

All terms starting with W

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.