Bashexit code > 0

command not found

$bash: foobar: command not found

Analysis

The shell cannot find the executable you are trying to run in your PATH.

Common Triggers

  • Typo in the command name.
  • The tool is not installed.
  • The directory containing the tool is not in your $PATH.

Debug Checks

  • $Run echo $PATH to see searched directories.
  • $Try which <command>.

Resolution

1
Install the missing tool.
2
Add the directory to PATH in .bashrc or .zshrc.
3
Use the absolute path: ./script.sh.

Metadata

Tool
Bash
Severity
High
Tags
#bash#path#executable