bash: command not found
The shell can’t find an executable with that name in any directory on your PATH.
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
- Install the package (
apt install,brew install) - Add the directory to PATH in ~/.bashrc / ~/.zshrc
- Use absolute paths in cron
- Convert line endings:
dos2unix script.sh
Detailed fix by platform
Linux
type -a <cmd>/which <cmd>show what the shell resolves;echo $PATHshows where it looks.
How to diagnose
- Installed — Is the package installed?
- 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026