Skip to content
command not found

command not found

DodaTech 2 min read

The command not found error in bash or zsh means the shell couldn’t locate an executable matching the name you typed. This is usually a missing package, a PATH issue, or a simple typo.

What It Means

When you type a command, the shell searches through directories listed in the $PATH environment variable. If none of those directories contain an executable with that name, the shell returns command not found. It does not mean the command never existed — it just isn’t reachable right now.

Why It Happens

  • The required package is not installed on the system.
  • The command name is misspelled.
  • The command is installed in a directory not listed in your $PATH.
  • You’re using a different shell that doesn’t have the command aliased.
  • The binary was removed or the path to it is corrupted.
  • The command requires a different interpreter (e.g., Python vs Python 3).

How to Fix It

1. Check for typos

# Wrong
gti status

# Right
git status

Common mix-ups: gti/git, sl/ls, cd../cd .., pdy/pwd.

2. Install the missing package

On Debian/Ubuntu:

sudo apt update
sudo apt install <package-name>

On macOS with Homebrew:

brew install <package-name>

On RHEL/Fedora:

sudo dnf install <package-name>

3. Find where the command should be

apt search <command-name>
which <command-name>   # if installed but not in PATH

4. Add a directory to your PATH

If the command is installed but not found:

export PATH=$PATH:/usr/local/bin

To make it permanent, add the line above to ~/.bashrc or ~/.zshrc.

5. Run with the full path

If you know where the binary lives:

/usr/local/go/bin/go version

6. Use the correct interpreter

# Sometimes python3 instead of python
python3 script.py
python script.py
How do I see my current PATH?
Run echo $PATH. It prints a colon-separated list of directories. The shell searches them left to right. The first match wins.
What if the command was working before and suddenly stopped?
Your PATH may have changed (a bad export in your shell config), or the package was accidentally removed. Check ~/.bashrc or ~/.zshrc for recent edits, and reinstall the package if needed.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro