bash: command not found
The shell can’t find an executable with that name in any directory on your PATH.
command not foundis not recognized as an internal or external commandbad interpreter 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 not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Linux
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 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.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 12 Oct 2026