which Command Generator
Generate which commands to locate executables in PATH
Getting Started with which
## What is which?
`which` takes a command name and returns the full path of the executable that your shell would actually run. It walks `$PATH` in order, so it tells you which version of a command wins when several are installed. It is the go-to tool for diagnosing "command not found" issues, alias/shadowing problems, and PATH configuration mistakes.
## How to Use
1. **Set Options**: Toggle `-a` (all matches) or `-s` (silent/exit-code mode). 2. **Enter Name**: Type the executable name to look up. 3. **Copy & Run**: Paste the generated command into your terminal.
The exit status is `0` if the command is found and non-zero otherwise, so `which` works well in shell scripts.
Common Options
### Name (positional) The executable name to resolve, e.g. `python`, `docker`, `node`. `which` reports the first match in `$PATH`.
### `-a` All matches List every matching executable in `$PATH`, not just the first. Use this to detect duplicate or shadowed installs (e.g. two `python` binaries in different directories).
### `-s` Silent mode Print nothing — rely solely on the exit status (0 = found, non-zero = not found). Ideal for conditionals in scripts: `if which docker -s; then ...`.
▶What is the difference between which, whereis, and locate?
▶How do I find every installed copy of a command?
▶Why does `which` not find a command I can run?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee