Error Codes Wiki

Linux Exit Code 127 — Command Not Found

Warningcommand

Overview

Linux exit code 127 means the command could not be found in the system PATH or is not installed.

Key Details

  • bash: command: command not found
  • Shell searched all PATH directories without finding the command
  • The program may not be installed
  • PATH variable may be misconfigured

Common Causes

  • Program is not installed on the system
  • Program not in any directory listed in $PATH
  • Typo in the command name
  • Shell profile not loaded (non-login shell)

Steps

  1. 1Check if installed: which commandname or type commandname
  2. 2Install the package: apt install packagename or yum install packagename
  3. 3Check PATH: echo $PATH
  4. 4Use full path: /usr/local/bin/commandname

Tags

linuxcommandexit code 127troubleshootingfix

More in Command

Frequently Asked Questions

Debian/Ubuntu: apt-file search commandname. RHEL/Fedora: dnf provides commandname.