Setting the PATH Environment Variable

What is PATH variable?
For eg running a command that is installed somewhere in the drive or

directory then you have to go to the drive or directory to run that command.
Instead you set PATH environment need not worry about running the command

from anywhere.

How to check PATH setting?

DOS/Windows type

PATH

Linux/UNIX  type

echo $PATH

Setting the PATH for Linux

PATH=${PATH}:/usr/local/java
export PATH

The expression ${PATH} is the value of the existing PATH. The export

statement means that shells (and other programs) started from this shell

will also have the PATH setting exported to it. You can put these statements

in the file named .bash_profile in your home directory and it will be

exectuted to set the PATH every time you log in. And ever time you open a

command-line window.

Setting the PATH for Windows

Using GUI
Start->Settings->Control Panel->System ->Advanced tab->Environment Variables

button ->Select PATH ->Edit the PATH

Using command
PATH D:\program Files\MySQL\MySQL Server 5.0\bin;%PATH%

where  %PATH% in the new path setting causes the old path to be
appended to the new setting.

Usages
PATH [[drive:]path[;…][;%PATH%]
PATH ;

Type PATH ; to clear all search-path settings and direct cmd.exe to search
only in the current directory.
Type PATH without parameters to display the current path.
Including %PATH% in the new path setting causes the old path to be
appended to the new setting.

Advertisements

Posted on April 28, 2011, in General, Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: