Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →In Bash, start with type -a tool and type -P tool, then inspect $PATH and check whether the executable exists and can run. If it exists outside the directories in PATH, call it by pathname or add its trusted directory to the right shell’s PATH. If it is absent, find and install the distribution package that provides it. If the command was recently moved or removed, check Bash’s remembered location with hash -t tool and refresh it with hash -r.
What “command not found” can mean
For a command name with no slash, Bash first checks for a function and then a builtin; it then searches the directories in PATH for an executable. Bash may also use a remembered command location. A name containing a slash, such as ./tool or /opt/tool/bin/tool, is treated as a pathname rather than searched through PATH. See the Bash Reference Manual’s command search and execution rules.
As an Amazon Associate I earn from qualifying purchases.
If the search fails and no command_not_found_handle function is defined, Bash reports an error and returns status 127. Some distributions or shell setups customize the error display, so the wording alone does not establish whether a program is uninstalled or merely outside PATH.
Check how Bash resolves the name
Replace tool below with the command you tried:
printf '%sn' "$SHELL"
type -a tool
type -P tool
type -a lists the ways and locations Bash can resolve the name, including aliases, keywords, functions, builtins, and files. type -P forces a search for executable files in PATH. These options are documented in the Bash builtins manual.
#1 Best Overall
$SHELL often identifies your login shell, not necessarily the shell currently interpreting the command. If you are troubleshooting a script, terminal, or application-launched session, check which shell actually runs it and use that shell’s own lookup commands and documentation. This procedure is specifically for Bash.
Inspect PATH and check the executable
Print the current shell’s search list:
printf '%sn' "$PATH"
PATH is a colon-separated list of directories Bash searches for command names. Check whether the expected executable is in one of those directories. If you know a likely installation location, inspect the exact file and try it by pathname:
ls -l /likely/directory/tool
/likely/directory/tool --version
If the pathname works but bare tool does not, the issue points to command resolution or PATH. If the pathname itself fails, read the error before changing the search list: permissions or an invalid executable or interpreter can cause failures unrelated to PATH.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsFix PATH when the executable already exists
Run it once by pathname
For a one-time invocation, use the full pathname, for example /opt/tool/bin/tool --version. This avoids changing shell configuration.
Test a temporary PATH change
To make the executable discoverable by name in the current shell, prepend its known, trusted directory while preserving the existing list:
PATH="/known/tool-directory:$PATH"
export PATH
Then try tool again. Avoid replacing PATH with only the new directory; doing so can make standard commands unavailable. An empty element in PATH has shell-specific implications, including possible current-directory lookup, so do not add one casually.
Rank #4
Make the change persistent only in the right startup file
For a persistent change, put the assignment in the startup file read by the shell and session that need it. There is no single universal file: the right choice depends on the shell, whether it is interactive or a login shell, and how it was started. Add only a directory you trust, and verify the result in the same kind of session where the command failed.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Install the program if its executable is absent
If you cannot find an executable at the expected location, identify your Linux distribution and use its official package search or package documentation to find which package provides the command. Package names can differ from executable names, so do not assume that a package has the same name as the command. Install it through the system’s normal package manager and follow local administrator policy. The exact package and installation command depend on the distribution.
Best Value
Refresh Bash’s remembered command location
Bash can remember full command pathnames to avoid repeating a search. If a command was moved, upgraded, or removed while the shell remained open, inspect its remembered location and clear the cache:
hash -t tool
hash -r
hash -t tool displays the remembered pathname if one is recorded; hash -r clears remembered locations so Bash can search again. Assigning a new PATH in Bash also clears the hashed filenames. See the Bash manual’s hash builtin documentation.
Quick Recap
Choose the fix based on what you found
| Finding | Next step |
|---|---|
The executable exists and its pathname runs, but its directory is not in the current PATH. |
Use the pathname for a one-off run, or add the trusted directory to the relevant shell’s PATH. |
| No executable is present at the locations you checked. | Use your distribution’s official package information to identify and install the provider package. |
| The command used to work, but its location may have changed during this shell session. | Check hash -t tool, then run hash -r to clear Bash’s remembered locations. |
| The pathname exists, but running it fails. | Investigate the specific error, including permissions or an invalid executable or interpreter; changing PATH will not fix those issues. |
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.




