Understanding the Error
Bash cannot find the command you typed.
Fix 1: Check If Command is Installed
# Try finding it
which command_name
whereis command_name
type command_name
# Search package that provides it
# Ubuntu/Debian: apt-file search command_name
# CentOS/RHEL: yum whatprovides */command_name
Fix 2: Install Missing Package
# Common missing commands
sudo apt install curl
sudo apt install wget
sudo apt install git
sudo apt install vim
sudo apt install htop
sudo apt install net-tools # ifconfig, netstat
sudo apt install iputils-ping # ping
Fix 3: Fix PATH Variable
# Check current PATH
echo $PATH
# Add common directories
export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
# Make permanent
echo 'export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' >> ~/.bashrc
source ~/.bashrc
Fix 4: Use Full Path
# Instead of "command", use:
/usr/bin/command
/usr/local/bin/command
Fix 5: Alias Existing Command
# In ~/.bashrc
alias python=python3
alias ll='ls -la'
Fix 6: Check for Typo
# Common typos
grep → gerp
ls → sl
mkdir → md