PATH (variable)

PATH (variable)

PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located. In general, each executing process or user session has its own PATH setting.

Unix and Unix-like

On POSIX and Unix-like operating systems, the $PATH variable is specified as a list of one or more directory names separated by colon (:) characters.[1][2]

The /bin, /usr/bin, and /usr/local/bin directories are typically included in most users' path setting (although this varies from implementation to implementation). The current directory (.) is sometimes included as well, allowing programs residing in the current working directory to be executed directly. Superuser (root) accounts as a rule do not include it in the path, however, in order to prevent the accidental execution of scripts residing in the current directory. Executing such a program requires the deliberate use of a directory prefix (./) on the command name.

When a command name is specified by the user or an exec call is made from a program, the system searches the path, examining each directory from left to right in the list, looking for a filename 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.

DOS, OS/2, and Windows

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.[3]

The Windows system directory (typically C:\WINDOWS\system32) is typically the first directory in the path, followed by many (but not all) of the directories for installed software packages. Many programs do not appear in the path as they are not designed to be executed from a command window, but rather from a Graphical User Interface.

When a command is entered in a command shell or a system call is made by a program to execute a program, the system first searches the current working directory and then searches the path, examining each directory from left to right, looking for an executable filename that matches the command name given. Executable programs have filename extensions of EXE or COM, and batch scripts have extensions of BAT or CMD. Other executable filename extensions can be registered with the system as well.

Once a matching executable file is found, the system spawns a new process in which to run it.

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Path (variable) — PATH is an environment variable on Unix like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located. In general, each executing process or user session has its own PATH… …   Wikipedia

  • Path — PathPath may also refer to:*Course (navigation), the intended path of a vehicle over the surface of the Earth *Trail, footpath, or bicycle way in rural or urban settings *Sidewalk running along the edge of a road, in some varieties of English… …   Wikipedia

  • PATH — This article is about the acronym PATH . For other uses of path , see Path. PATH may refer to: Port Authority Trans Hudson, a subway system linking Manhattan, New York with locations in northern New Jersey PATH (Atlanta), trail building… …   Wikipedia

  • Path (computing) — A path is the general form of a file or directory name, giving a file s name and its unique location in a file system. Paths point to their location using a string of characters signifying directories, each path component separated by a… …   Wikipedia

  • $PATH — Variable d environnement En informatique, les variables d’environnement sont des variables dynamiques utilisées par les différents processus d’un système d’exploitation (Windows, Unix, etc.). Elles servent à communiquer des informations entre… …   Wikipédia en Français

  • $path — Variable d environnement En informatique, les variables d’environnement sont des variables dynamiques utilisées par les différents processus d’un système d’exploitation (Windows, Unix, etc.). Elles servent à communiquer des informations entre… …   Wikipédia en Français

  • Variable length intake manifold — (VLIM) is an automobile engine manifold technology. As the name implies, VLIM can vary the length of the intake tract in order to optimize power and torque, as well as provide better fuel efficiency.There are two main effects of variable intake… …   Wikipedia

  • PATH (informática) — PATH es una variable de entorno de los sistemas operativos POSIX y los sistemas de Microsoft, en ella se especifican las rutas en las cuales el intérprete de comandos debe buscar los programas a ejecutar. Generalmente es mencionada como $PATH, en …   Wikipedia Español

  • Variable envelope return path — (VERP) is a technique used by some electronic mailing list software to enable automatic detection and removal of undeliverable e mail addresses. It works by using a different return path (also called envelope sender ) for each recipient of a… …   Wikipedia

  • Path coefficient — Path coefficients are standardized versions of linear regression weights which can be used in examining the possible causal linkage between statistical variables in the structural equation modeling approach. The standardization involves… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”