command not found
The error bash prints, with exit status 127, when a command name matches no alias, function, builtin or file on PATH.
In more detail
It usually means a typo, a program that is not installed, or a PATH that lacks its directory, as happens under cron. Status 126 is the neighbouring case: the file was found but cannot be executed.
Related terms
- PATH — An environment variable holding a list of folders the shell searches, in order, to find the program for a command you type.
- exit code — A number a process returns when it finishes: 0 means success, anything else means something went wrong.
- syntax error — A mistake in the form of code, such as an unclosed bracket or an if without its matching end, that the language cannot understand and so will not run.
Taught in
- What A Shell Is, And What Bash Is — Bash Scripting & Command Line Automation
- Help, History, Completion And Aliases — Bash Scripting & Command Line Automation
- Shell Variables, The Environment And export — Bash Scripting & Command Line Automation
- Exit Codes, And What Success Means — Bash Scripting & Command Line Automation
- Debugging: set -x, bash -n And Reading The Error — Bash Scripting & Command Line Automation