शब्दकोश · ऑपरेटिंग सिस्टम और सॉफ़्टवेयर

PATH Variable

The PATH variable is an environment variable listing the folders an operating system searches to find a program when you type its name in a terminal.

अपडेट: अक्टूबर 6, 2026

The PATH variable is an environment variable containing an ordered list of directories. When you type a command such as python without a full path, the shell checks each directory in PATH, left to right, and runs the first matching executable. Entries are separated by : on Linux and macOS, and ; on Windows.

Why it matters

A "command not found" or "is not recognized as an internal or external command" error often means the program's folder is not in PATH. Adding the right directory lets you run tools from anywhere, while a wrong order can run an unexpected version of a program.

Example

$ echo $PATH
/usr/local/bin:/usr/bin:/bin

$ export PATH="$HOME/tools:$PATH"

The second line puts ~/tools first. To make it permanent, add it to ~/.bashrc or ~/.zshrc. On Windows, edit it under System Properties, Environment Variables, then restart the terminal.

Common mistakes

  • Overwriting PATH with export PATH=/new/dir and losing all existing entries.
  • Not reopening the terminal after changing it, so the old value remains.
  • Putting a writable or untrusted folder early in PATH, which lets a rogue program impersonate a trusted command.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.