Bash $PATH Debugger
Debug your $PATH variable, find duplicate entries, missing directories, and fix ordering issues.
echo $PATH — then paste the output here"Load My PATH" only works when this page is opened locally in a terminal browser — it cannot read your actual system PATH from a web browser.
How to use the Bash $PATH Debugger
- 1Run `echo $PATH` in your terminal and paste the output into the input field.
- 2The tool splits the colon-separated PATH string and lists each directory as a separate entry.
- 3Review the output for duplicates (shown in amber) and empty entries (shown in red) that waste lookup time.
- 4Copy the cleaned PATH string with duplicates removed and add it to your ~/.bashrc or ~/.zshrc.
Run this script on a real Linux server
Get $200 free credit — DigitalOcean
Get $200 Free →Affiliate link · we earn a commission
Frequently Asked Questions
How do I see my current $PATH?
Run `echo $PATH` in the terminal. It prints all directories separated by colons. For a more readable format, run `echo $PATH | tr ":" "\n"` to list each directory on its own line.
Why does PATH order matter in bash?
When you run a command, the shell searches PATH directories left to right and uses the first binary it finds. If you have two versions of a tool installed in different directories, the one in the earlier PATH entry wins. This is why putting your local bin directories first is important.
How do I permanently add a directory to $PATH?
Add `export PATH="/your/dir:$PATH"` to ~/.bashrc (bash) or ~/.zshrc (zsh). Then run `source ~/.bashrc` to apply changes to the current session. New terminal sessions will pick it up automatically.
What causes "command not found" errors in bash?
The binary is either not installed, or its directory is missing from $PATH. Paste your PATH into this tool to check whether the expected directory is present. If the directory is there, verify the binary exists with `which commandname` or `ls /expected/path/`.