Agentic Research

PATH and file paths

Also: 路徑 · 環境變數 PATH · command not found

A path is a file's address. PATH is the list of folders the computer searches when you name a program.

When you will meet it

"command not found" is the most common beginner error, and nine times in ten the tool IS installed — PATH just does not include its folder. Understanding this saves an afternoon of reinstalling.

An analogy

If you just say "send a burger", someone needs a list of places to look. PATH is that list, and order matters: the first match wins.

Minimal example

echo $PATH            # 看目前的搜尋清單(Windows PowerShell:$env:Path -split ';')
which claude          # 這個程式實際在哪裡(Windows:where.exe claude)

If `which` prints a path, the tool exists and PATH is the problem. If it prints nothing, the tool really is missing.

What people get wrong

  • Reinstalling on sight of "command not found". Check with which/where first.
  • Forgetting quotes around a path with spaces. `cd My Projects` reads as two arguments; write `cd "My Projects"`.

Related terms

Next