command not found Linux Origin: Platform & cloud Last updated 12 Oct 2026

bash: command not found

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

Exact message you may see command not foundis not recognized as an internal or external commandbad interpreter
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 not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

Argument list too long — bash: /bin/rm: Argument list too long (Linux)Argument list too longaws: error: argument — aws: error: argument command: Invalid choice / Unknown options (AWS)aws: error: argumentdocker-compose: command not found — docker-compose: command not found / 'compose' is not a docker command (Docker)docker-compose: comma…dpkg lock — E: Could not get lock /var/lib/dpkg/lock-frontend — is another process using it? (Linux)dpkg lockEACCES — Linux: Permission denied (Linux)EACCESENOENT — Error: ENOENT: no such file or directory (Node.js)ENOENTerror while loading shared libraries — error while loading shared libraries: libX.so.N: cannot open shared object file: No such file or directory (Linux)error while loading s…exec format error — exec /usr/local/bin/docker-entrypoint.sh: exec format error (Docker)exec format errorcommand n…

Explore the map of this error Full error map →

🧠 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.