Fix “Command Not Found” in Linux

Common reasons why Linux cannot find a command and how to resolve it.

By Rageypeep · Created 2026-03-04 11:39 UTC · Updated 2026-03-04 11:42 UTC

  • linux
  • terminal
  • troubleshooting
  • beginner

Fix "Command Not Found" in Linux

What it means

Linux cannot find the program you tried to run.

Example:

command: not found

Possible Causes

  • Program is not installed
  • The command name is incorrect
  • The program is not in your PATH

Fix 1 — Install the program

Example on Ubuntu:

sudo apt install program_name

Fix 2 — Check spelling

Linux commands are case sensitive.

Example:

python3 != Python3

Fix 3 — Check PATH

See where commands are searched:

echo $PATH

Find the command location:

which command_name

Fix 4 — Run from current directory

If running a script in the current folder:

./script.sh

Notes

  • Many new users forget the "./" prefix when running local scripts.

Score: 0

Comments

Loading comments...

View-only mode. Editing requires your private owner token.