The PATH is an important concept when working on the command line. It's a list
of directories that tell your operating system where to look for programs, so
that you can just write script instead of /home/me/bin/script or
C:\Users\Me\bin\script. But different operating systems have different ways to
add a new directory to it:
- The first step depends which version of Windows you're using:
 
- If you're using Windows 8 or 10, press the Windows key, then search for and select "System (Control Panel)".
 - If you're using Windows 7, right click the "Computer" icon on the desktop and click "Properties".
 
- Click "Advanced system settings".
 - Click "Environment Variables".
 - Under "System Variables", find the 
PATHvariable, select it, and click "Edit". If there is noPATHvariable, click "New". - Add your directory to the beginning of the variable value followed by 
;(a semicolon). For example, if the value wasC:\Windows\System32, change it toC:\Users\Me\bin;C:\Windows\System32. - Click "OK".
 - Restart your terminal.
 
- Open the 
.bash_profilefile in your home directory (for example,/Users/your-user-name/.bash_profile) in a text editor. - Add 
export PATH="your-dir:$PATH"to the last line of the file, where your-dir is the directory you want to add. - Save the 
.bash_profilefile. - Restart your terminal.
 
- Open the 
.bashrcfile in your home directory (for example,/home/your-user-name/.bashrc) in a text editor. - Add 
export PATH="your-dir:$PATH"to the last line of the file, where your-dir is the directory you want to add. - Save the 
.bashrcfile. - Restart your terminal.
 
RapidEE is an outstanding alternative to the Windows built-in control panel dialog box for environment variable management and viewing, including the
PATHvariable, of course. For those who like text walls, read on! xPBTW, thanks nex3. Cool tips!
TL;DR Version:
Although it's not necessary in the slightest, and for the standard non-hacker end-user probably smacks of overkill, if you are like me in meeting the following two criteria:
PATH) fairly often, like most developers,then you should find in RapidEE a beautiful tool to replace the tiny control panel dialog box. The native Windows method is fine for simple, "one-off" changes to
PATHor a different variable, for a more comprehensive, "bird's eye" view of both system and user variables and the ability to add/delete or modify them—all quickly and easily, without the confusion the regular dialog can entail—the handy, small program called Rapid Environment Editor (or RapidEE) is more than sufficient. Although it's closed-source (afaik), it's free, up-to-date and even supports operations on variables via command-line arguments.I'm fully aware there are other apps that fill the same need, many of them FOSS, but when I use Windows RapidEE has served me very well, and its features continue to save me many headaches from confusion, tedium and their ilk. Anyway, happy hacking, guys, and thanks again nex3!