PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of where executable programs are located. In general, each executing process or user session has its own PATH setting.
Multics originated the idea of a search path. The early Unix shell only looked for program names in /bin, but by Version 3 Unix the directory was too large and /usr/bin, and a search path, became part of the operating system.
On POSIX and Unix-like operating systems, the PATHvariableisspecifiedasalistofoneormoredirectorynamesseparatedbycolon(:)characters.DirectoriesinthePATH−stringarenotmeanttobeescaped,makingitimpossibletohavedirectorieswith:intheirname.The/bin,/usr/bin,and/usr/local/bindirectoriesaretypicallyincludedinmostusers′PATH setting (although this varies from implementation to implementation). The superuser also typically has /sbin and /usr/sbin entries for easily executing system administration commands. The current directory (.) is sometimes included by users as well, allowing programs residing in the current working directory to be executed directly. System administrators as a rule do not include it in PATHinordertopreventtheaccidentalexecutionofscriptsresidinginthecurrentdirectory,suchasmaybeplacedtherebyamalicioustarbomb.Inthatcase,executingsuchaprogramrequiresspecifyinganabsolute(/home/userjoe/bin/script.sh)orrelativepath(./script.sh)onthecommandline.Whenacommandnameisspecifiedbytheuseroranexeccallismadefromaprogram,thesystemsearchesthroughPATH, examining each directory from left to right in the list, looking for a that matches the command name. Once found, the program is executed as a child process of the command shell or program that issued the command.
On DOS, OS/2, and Windows operating systems, the %PATH% variable is specified as a list of one or more directory names separated by semicolon (;) characters.