Error Reference › Linux / Server
Linux / Server

command not found

The shell couldn't find that command — it isn't installed or isn't on PATH.

What it looks like

bash: composer: command not found

What does "command not found" mean?

Printed by the shell when no program with that name exists in any directory listed in PATH. It is common right after installing something (the terminal has not reloaded PATH) and in cron jobs, which run with a very short PATH.

What causes "command not found"?

  • The program isn't installed.
  • It's installed but not on $PATH.
  • A typo in the command name.

How do I confirm the cause?

  1. Check whether it is installed at all: which composer, or command -v composer.
  2. If it is installed, find where (for example ~/.local/bin or /usr/local/bin) and check that folder is in echo $PATH.
  3. In cron or CI, print PATH from inside the job — it is usually much shorter than your terminal’s.
  4. Inside Docker containers, remember that slim base images leave out many common tools — the command may need installing in the Dockerfile.

How do I fix "command not found"?

  • Install the package that provides it.
  • Add its directory to PATH, or call it by full path.
  • Check the spelling.

How do I stop it happening again?

  • Use full paths to programs in cron jobs and scripts (/usr/local/bin/composer).
  • Document and script the tools a project needs, so a fresh machine can install them in one step.
Got a different error? Paste it into the Explain This Error tool → Identifies the family and the fix — runs locally, nothing uploaded.

Related errors