command not found 🐧 Linux

bash: command not found

The shell can’t find an executable with that name in any directory on your PATH.

Seen on: Linux Windows

Meaning

Either the program isn’t installed, it’s installed in a directory not on PATH, or there’s a typo. Scripts run by cron/systemd often have a minimal PATH.

Common causes

  • Program not installed
  • Installed to a directory not on PATH (~/.local/bin, ~/.npm-global/bin)
  • Typo
  • Cron/systemd minimal PATH
  • Windows line endings in a script (/bin/bash^M: bad interpreter)

⚡ Quick fix

  1. Install the package (apt install, brew install)
  2. Add the directory to PATH in ~/.bashrc / ~/.zshrc
  3. Use absolute paths in cron
  4. Convert line endings: dos2unix script.sh

Detailed fix by platform

Linux

  1. type -a <cmd> / which <cmd> show what the shell resolves; echo $PATH shows where it looks.

How to diagnose

  1. Installed — Is the package installed?
  2. PATH — Is its directory on PATH in this context?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.