When a shell answers bash: frobnicate: command not found (zsh words it “command not found: frobnicate”), it searched every directory in the PATH variable and found no executable file with that exact name. That single fact has four common roots: the program is not installed, the name is misspelled or belongs to a different system, the program exists but its directory is not on the PATH, or the “program” is a file in the current directory, which the shell deliberately does not search.
ipconfig is Windows, ifconfig or ip is Linux; brew is macOS). Also confirm you typed the command, not its package: the package net-tools provides ifconfig; installing “ifconfig” fails because no package carries that name.type -a name and which name. After a fresh install in the same session, the shell may have cached the old (empty) answer; hash -r clears bash's command cache.sudo apt install <pkg> (Debian/Ubuntu), sudo dnf install (Fedora/RHEL), sudo pacman -S (Arch). Tools like apt-file or dnf provides answer “which package ships this file” precisely.~/.local/bin, language toolchains, and manually unpacked software), either call it by full path or add its directory: export PATH="$HOME/.local/bin:$PATH" in the shell's startup file for permanence../script.sh. The leading ./ is not decoration; the current directory is excluded from PATH on purpose, so a downloaded file cannot shadow system commands.sudo: xyz: command not found when the plain command works: sudo uses its own secure_path, which omits user directories like ~/.local/bin. Use the full path under sudo, or install the tool system-wide.echo $PATH in both contexts before changing anything.Why does ./ matter for scripts? Shells search PATH directories only. The current directory is not one of them, by design, so ./script.sh (an explicit path) is how you run a local file. Typing the bare name asks the system for an installed command by that name.
I installed it and the same shell still says not found, why? Either the shell cached the negative lookup (hash -r fixes bash), or the package installed its binary into a directory your PATH lacks. type -a after hash -r tells you which.
How do I find which package provides a command? Debian/Ubuntu: apt-file search bin/name (after apt-file update). Fedora/RHEL: dnf provides '*/bin/name'. Arch prints suggestions automatically for many commands via pkgfile. Online package indexes answer it too.