command not found
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 statusCommon 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 PATH4. Add a directory to your PATH
If the command is installed but not found:
export PATH=$PATH:/usr/local/binTo 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 version6. Use the correct interpreter
# Sometimes python3 instead of python
python3 script.py
python script.pyBuilt by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro