<s>
PATH	O
is	O
an	O
environment	O
variable	O
on	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
,	O
DOS	B-Device
,	O
OS/2	B-Application
,	O
and	O
Microsoft	B-Application
Windows	I-Application
,	O
specifying	O
a	O
set	O
of	O
directories	B-Application
where	O
executable	B-Application
programs	I-Application
are	O
located	O
.	O
</s>
<s>
In	O
general	O
,	O
each	O
executing	O
process	B-Operating_System
or	O
user	B-Operating_System
session	I-Operating_System
has	O
its	O
own	O
PATH	O
setting	O
.	O
</s>
<s>
Multics	B-Application
originated	O
the	O
idea	O
of	O
a	O
search	B-Application
path	I-Application
.	O
</s>
<s>
The	O
early	O
Unix	B-Application
shell	I-Application
only	O
looked	O
for	O
program	O
names	O
in	O
/bin	O
,	O
but	O
by	O
Version	B-Operating_System
3	I-Operating_System
Unix	I-Operating_System
the	O
directory	B-Application
was	O
too	O
large	O
and	O
/usr/bin	O
,	O
and	O
a	O
search	B-Application
path	I-Application
,	O
became	O
part	O
of	O
the	O
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
On	O
POSIX	O
and	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
,	O
the	O
$PATH	B-Application
variable	O
is	O
specified	O
as	O
a	O
list	O
of	O
one	O
or	O
more	O
directory	B-Application
names	O
separated	O
by	O
colon	O
(	O
:	O
)	O
characters	O
.	O
</s>
<s>
Directories	B-Application
in	O
the	O
PATH-string	O
are	O
not	O
meant	O
to	O
be	O
escaped	O
,	O
making	O
it	O
impossible	O
to	O
have	O
directories	B-Application
with	O
:	O
in	O
their	O
name	O
.	O
</s>
<s>
The	O
/bin	O
,	O
/usr/bin	O
,	O
and	O
/usr/local/bin	O
directories	B-Application
are	O
typically	O
included	O
in	O
most	O
users	O
 '	O
$PATH	B-Application
setting	O
(	O
although	O
this	O
varies	O
from	O
implementation	O
to	O
implementation	O
)	O
.	O
</s>
<s>
The	O
superuser	B-Application
also	O
typically	O
has	O
/sbin	O
and	O
/usr/sbin	O
entries	O
for	O
easily	O
executing	O
system	B-Application
administration	I-Application
commands	O
.	O
</s>
<s>
The	O
current	B-Application
directory	I-Application
(	O
.	O
)	O
</s>
<s>
is	O
sometimes	O
included	O
by	O
users	O
as	O
well	O
,	O
allowing	O
programs	O
residing	O
in	O
the	O
current	B-Application
working	I-Application
directory	I-Application
to	O
be	O
executed	O
directly	O
.	O
</s>
<s>
System	B-Application
administrators	I-Application
as	O
a	O
rule	O
do	O
not	O
include	O
it	O
in	O
$PATH	B-Application
in	O
order	O
to	O
prevent	O
the	O
accidental	O
execution	O
of	O
scripts	O
residing	O
in	O
the	O
current	B-Application
directory	I-Application
,	O
such	O
as	O
may	O
be	O
placed	O
there	O
by	O
a	O
malicious	O
tarbomb	O
.	O
</s>
<s>
When	O
a	O
command	O
name	O
is	O
specified	O
by	O
the	O
user	O
or	O
an	O
exec	B-Operating_System
call	O
is	O
made	O
from	O
a	O
program	O
,	O
the	O
system	O
searches	O
through	O
$PATH	B-Application
,	O
examining	O
each	O
directory	B-Application
from	O
left	O
to	O
right	O
in	O
the	O
list	O
,	O
looking	O
for	O
a	O
filename	B-Device
that	O
matches	O
the	O
command	O
name	O
.	O
</s>
<s>
Once	O
found	O
,	O
the	O
program	O
is	O
executed	O
as	O
a	O
child	B-Operating_System
process	I-Operating_System
of	O
the	O
command	O
shell	O
or	O
program	O
that	O
issued	O
the	O
command	O
.	O
</s>
<s>
On	O
DOS	B-Device
,	O
OS/2	B-Application
,	O
and	O
Windows	B-Application
operating	I-Application
systems	I-Application
,	O
the	O
%PATH%	O
variable	O
is	O
specified	O
as	O
a	O
list	O
of	O
one	O
or	O
more	O
directory	B-Application
names	O
separated	O
by	O
semicolon	O
(	O
;	O
)	O
characters	O
.	O
</s>
<s>
The	O
Windows	O
system	O
directory	B-Application
(	O
typically	O
C:\WINDOWS\system32	O
)	O
is	O
typically	O
the	O
first	O
directory	B-Application
in	O
the	O
path	O
,	O
followed	O
by	O
many	O
(	O
but	O
not	O
all	O
)	O
of	O
the	O
directories	B-Application
for	O
installed	O
software	O
packages	O
.	O
</s>
<s>
Many	O
programs	O
do	O
not	O
appear	O
in	O
the	O
path	O
as	O
they	O
are	O
not	O
designed	O
to	O
be	O
executed	O
from	O
a	O
command	O
window	O
,	O
but	O
rather	O
from	O
a	O
Graphical	B-Application
User	I-Application
Interface	I-Application
.	O
</s>
<s>
Some	O
programs	O
may	O
add	O
their	O
directory	B-Application
to	O
the	O
front	O
of	O
the	O
PATH	B-Application
variable	I-Application
's	O
content	O
during	O
installation	O
,	O
to	O
speed	O
up	O
the	O
search	O
process	B-Operating_System
and/or	O
override	O
OS	O
commands	O
.	O
</s>
<s>
In	O
the	O
DOS	B-Device
era	O
,	O
it	O
was	O
customary	O
to	O
add	O
a	O
or	O
line	O
to	O
AUTOEXEC.BAT	O
.	O
</s>
<s>
When	O
a	O
command	O
is	O
entered	O
in	O
a	O
command	O
shell	O
or	O
a	O
system	O
call	O
is	O
made	O
by	O
a	O
program	O
to	O
execute	O
a	O
program	O
,	O
the	O
system	O
first	O
searches	O
the	O
current	B-Application
working	I-Application
directory	I-Application
and	O
then	O
searches	O
the	O
path	O
,	O
examining	O
each	O
directory	B-Application
from	O
left	O
to	O
right	O
,	O
looking	O
for	O
an	O
executable	B-Application
filename	B-Device
that	O
matches	O
the	O
command	O
name	O
given	O
.	O
</s>
<s>
Executable	B-Application
programs	I-Application
have	O
filename	B-Device
extensions	O
of	O
EXE	O
or	O
COM	O
,	O
and	O
batch	O
scripts	O
have	O
extensions	O
of	O
BAT	O
or	O
CMD	O
.	O
</s>
<s>
Other	O
executable	B-Application
filename	B-Device
extensions	O
can	O
be	O
registered	O
with	O
the	O
system	O
as	O
well	O
.	O
</s>
<s>
Once	O
a	O
matching	O
executable	B-Application
file	I-Application
is	O
found	O
,	O
the	O
system	O
spawns	B-Language
a	O
new	O
process	B-Operating_System
which	O
runs	O
it	O
.	O
</s>
<s>
The	O
PATH	B-Application
variable	I-Application
makes	O
it	O
easy	O
to	O
run	O
commonly	O
used	O
programs	O
located	O
in	O
their	O
own	O
folders	O
.	O
</s>
<s>
If	O
used	O
unwisely	O
,	O
however	O
,	O
the	O
value	O
of	O
the	O
PATH	B-Application
variable	I-Application
can	O
slow	O
down	O
the	O
operating	B-General_Concept
system	I-General_Concept
by	O
searching	O
too	O
many	O
locations	O
,	O
or	O
invalid	O
locations	O
.	O
</s>
