Share to: share facebook share twitter share wa share telegram print page

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.

History

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

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.[2][3] Directories in the PATH-string are not meant to be escaped, making it impossible to have directories with : in their name.[4]

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 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 $PATH in order to prevent the accidental execution of scripts residing in the current directory, such as may be placed there by a malicious tarbomb. In that case, executing such a program requires specifying an absolute (/home/userjoe/bin/script.sh) or relative path (./script.sh) on the command line.

When a command name is specified by the user or an exec call is made from a program, the system searches through $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.[5]

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. Some programs may add their directory to the front of the PATH variable's content during installation, to speed up the search process and/or override OS commands. In the DOS era, it was customary to add a PATH {program directory};%PATH% or SET PATH={program directory};%PATH% line to AUTOEXEC.BAT.

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 that runs it.

The PATH variable makes it easy to run commonly used programs located in their own folders. If used unwisely, however, the value of the PATH variable can slow down the operating system by searching too many locations, or invalid locations.

Invalid locations can also stop services from running altogether, especially the 'Server' service which is usually a dependency for other services within a Windows Server environment.

References

  1. ^ McIlroy, M. D. (1987). A Research Unix reader: annotated excerpts from the Programmer's Manual, 1971–1986 (PDF) (Technical report). CSTR. Bell Labs. 139.
  2. ^ Open Group Unix Specification, Environment Variables
  3. ^ Open Group Unix Specification, execve() function
  4. ^ Dash exec.c as an example of an implementation of a PATH-string parser
  5. ^ Microsoft.com, PATH command

Read other articles:

Hansell Aráuz Datos personalesNombre completo Hansell Stiven Aráuz OvaresNacimiento Golfito, Puntarenas9 de agosto de 1989 (34 años)País Costa RicaNacionalidad(es) CostarricenseAltura 1,70 m (5′ 7″)Peso 78 kg (172 lb)Carrera deportivaDeporte FútbolClub profesionalDebut deportivo 2007(Brujas Fútbol Club)Club Puerto Golfito Fútbol ClubLiga Segunda División de Costa RicaPosición InteriorLateral derechoGoles en clubes 17Trayectoria Brujas F.C. (2007-2008) Asociaci...

كنيسة سانت أولاف. الغالبية العظمى من سكان جزر أولاند هم من أتباع الديانة المسيحية، حيث ينتمي حوالي 78.3% إلى الكنيسة الإنجيلية اللوثرية الفنلندية.[1] تحوي الجزر على أقدم الكنائس المسيحية في فنلندا، بما في ذلك كنيسة سانت أولاف، والتي يعود تاريخها إلى أواخر القرن الثالث عشر

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (نوفمبر 2022) Capranica شعار Capranicaشعار Capranicaشعار الاسم الرسمي Comune di Capranica   الإحداثيات 42°15′N 12°10′E / 42.250°N 12.167°E / 42.250; 12.167 تقسيم إداري  البلد إيطاليا[1][2&#...

Elena MartínElena Martín lors de la cérémonie des 12th Gaudí Awards en 2020.BiographieNaissance 1982Barcelone, EspagneNom de naissance Elena Martín GimenoNationalité EspagnoleFormation Université Pompeu-FabraActivité Scénariste, Réalisatrice, ActriceAutres informationsGenre artistique FictionDistinction Prix de la meilleure réalisatrice, Festival du cinéma espagnol de Malaga (2017)Œuvres principales Júlia ist (2017)modifier - modifier le code - modifier Wikidata Elena Martín G...

Het verdrag uit 1876 Het Verdrag van Kanghwa, ook wel bekend als het Japan-Korea verdrag van 1876, was een verdrag dat op 26 februari 1876 werd afgesloten tussen het Japanse Keizerrijk en het Koninkrijk Joseon. In het verdrag werd afgesproken dat drie Koreaanse havens open worden gesteld voor Japanse schepen. Het was een ongelijk verdrag, dat aan Korea werd opgedrongen door Japan. Het maakte een einde aan een lange periode waarin Korea nauwelijks toegankelijk was voor buitenlanders. Voorgesch...

Soundmonitor Hauptbildschirm des Soundmonitors Basisdaten Entwickler Chris Hülsbeck Erscheinungsjahr 1986 Kategorie Musiksoftware deutschsprachig nein Soundmonitor ist eine Software für den Heimcomputer Commodore 64, die in den 1980er Jahren sehr beliebt war. Das Programm wurde im Jahr 1986 vom Computer-Musiker Chris Hülsbeck im Rahmen eines Musik-Wettbewerbes der Computer-Zeitschrift 64’er programmiert. Es wurde in der 64’er 10/1986 als Listing des Monats veröffentlicht. Mit dieser S...

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: French Lycée in Brussels – news · newspapers · books · scholar · JSTOR (October 2018) (Learn how and when to remove this template message) School in Brussels, BelgiumFrench Lycée in BrusselsLycée français Jean-MonnetAddress9, Avenue du Lycée FrançaisBruss...

此條目需要精通或熟悉粒子物理的编者参与及协助编辑。請邀請適合的人士改善本条目。更多的細節與詳情請參见討論頁。 NNPDF開發者The NNPDF Collaboration类型粒子物理网站nnpdf.hepforge.org NNPDF是用於識別部分子分佈函數(英語:parton distribution functions)的首字母縮寫詞。 已隱藏部分未翻譯内容,歡迎參與翻譯。 NNPDF is the acronym used to identify the parton distribution functions from the NNPDF Co...

College in Chicago Wilbur Wright CollegeFormer namesWright Junior CollegeMottoEducation that WorksTypeCommunityEstablished1934AffiliationCity Colleges of ChicagoChancellorJuan SalgadoPresidentDavid PotashVice-presidentAlanka P. BrownStudents9,367[1]LocationChicago, Illinois, U.S.41°57′31.8″N 87°47′17.9″W / 41.958833°N 87.788306°W / 41.958833; -87.788306CampusLarge cityColorsBrown, greyMascotRamsWebsitewww.ccc.edu/colleges/wright/Pages/default.aspx W...

Austro-Hungarian then Yugoslav torpedo boat operating between 1921 and 1945 T3 T3 underway in 1931 History Austria-Hungary Name78 T then 78 BuilderStabilimento Tecnico Triestino Laid down22 October 1913 Launched4 March 1914 Commissioned23 August 1914 Out of service1918 FateAssigned to the Kingdom of Serbs, Croats and Slovenes Kingdom of Yugoslavia NameT3 AcquiredMarch 1921 Out of serviceApril 1941 FateCaptured by Italy Italy NameT3 AcquiredApril 1941 Out of service16 September 1943 FateCaptur...

『クリスマスの9nine 2012~聖なる夜の大騒動♪~』9nine の ライブ・ビデオリリース 2013年4月24日(DVD・Blu-ray)録音 2012年12月14日赤坂BLITZジャンル J-POPレーベル SME Recordsチャート最高順位 週間94位(オリコン)9nine 映像作品 年表 It's SHOW TIME!! Ver:SAKURA '09 Part.1(2009年)It's SHOW TIME!! Ver:SAKURA '09 Part.2(2009年)クリスマスの9nine 2012~聖なる夜の大騒動♪~(2012年)9nine 2013 LIVE「be!be!be...

Symbols used to write numbers The ten digits of the Arabic numerals, in order of value. A numerical digit (often shortened to just digit) is a single symbol used alone (such as 1) or in combinations (such as 15), to represent numbers in a positional numeral system. The name digit comes from the fact that the ten digits (Latin digiti meaning fingers)[1] of the hands correspond to the ten symbols of the common base 10 numeral system, i.e. the decimal (ancient Latin adjective decem ...

Pour les articles homonymes, voir Néoclassique. Johan Joseph Zoffany, Charles Towneley dans sa galerie de sculpture, 1782. Le néo-classicisme est à la fois un mouvement artistique, et une période stylistique qui émerge vers 1750 dans l'Europe des Lumières, contemporain et consécutif de la vogue du Grand Tour. Son apogée se situe vers 1780 jusqu'à 1800 et le déclin de son influence s'amorce vers 1810 avec la concurrence du romantisme. Le mouvement, né à Rome au moment où l'on red...

Administrative division of Nazi Germany Gau ThuringiaGau of Nazi Germany1925–1945 Flag Coat of arms Map of Nazi Germany showing its administrativesubdivisions (Gaue and Reichsgaue).CapitalWeimarHistoryGovernmentGauleiter • 1925–1927 Artur Dinter• 1927–1945 Fritz Sauckel History • Establishment 6 April 1925• Disestablishment 8 May 1945 Preceded by Succeeded by Thuringia Thuringia Bavaria Saxony-Anhalt (1945–1952) Today part ofGermany The Gau Thurin...

Ukrainian military general Serhiy Popko Serhiy Mikolayovych Popko (Ukrainian: Сергій Миколайович Попко, born 13 February 1961[1] in Kyiv[1]) is a Ukrainian military general and a former commander of the Ukrainian Ground Forces (2016-2019).[2][3] Previously, Popko was the commanding officer of the Ukrainian Anti-Terrorist Operation.[4] He is a graduate of the Kyiv Higher Combined Arms Command School. In 2017, he was promoted to colo...

Norrland hari ini (hijau tua). Norrland (dengarkanⓘ) adalah salah satu dari tiga landsdelar Swedia yang terletak di sebelah utara. Wilayah ini terdiri dari sembilan provinsi, yaitu Gästrikland, Medelpad, Ångermanland, Hälsingland, Jämtland, Härjedalen, Västerbotten, Norrbotten dan Lappland. Istilah Norrland tidak digunakan secara administratif, tetapi umum dipakai dalam bahasa sehari-hari, seperti untuk ramalan cuaca. Norrland adalah wilayah yang penduduknya jarang (kecuali di daerah ...

Smart City and satellite city of Kolkata, India For the area under Bidhannagar Municipal Corporation, see Rajarhat. Kolkata in West Bengal, IndiaNew TownKolkataBiswa Bangla GateApartment high-rises in New TownRajarhat City Centre 2DLF IT ParkMother's Wax MuseumNew Town skylineNew TownLocation in Kolkata, West Bengal, IndiaShow map of West BengalNew TownNew Town (India)Show map of IndiaNew TownNew Town (Asia)Show map of AsiaNew TownNew Town (Earth)Show map of EarthCoordinates: 22°35′22″N ...

1942 alliance between the United Kingdom and Soviet Union Comrades in Arms The Anglo-Soviet Treaty, formally the Twenty-Year Mutual Assistance Agreement Between the United Kingdom and the Union of Soviet Socialist Republics, established a military and political alliance between the Soviet Union and the British Empire. Background The Treaty followed on from the Anglo-Soviet Agreement of July 1941 that they would assist each other in fighting Germany and not seek a separate peace. The first mee...

Artikel ini bukan mengenai Kementerian Keamanan Publik (Tiongkok) atau Komisi Keamanan Nasional Partai Komunis Tiongkok. Lihat pula: Hukum Intelijensi Nasional Republik Rakyat Tiongkok Kementerian Keamanan Negara Republik Rakyat Tiongkok中华人民共和国国家安全部Zhōnghuá Rénmín Gònghéguó Guójiā Ānquán BùLambang Republik Rakyat TiongkokLambang Kementerian Keamanan NegaraBendera Kepolisian Rakyat TiongkokInformasi lembagaDibentuk1 Juli 1983; 40 tahun lalu (1983-07-01)...

1994 video gameShin Nekketsu Kōha Kunio-tachi no BankaJapanese SFC cover artDeveloper(s)Almanic CorporationRiver City Girls ZeroWayForwardPublisher(s)JP: Technōs JapanRiver City Girls ZeroArc System WorksDesigner(s)Yoshihisa KishimotoComposer(s)Kazunaka YamaneRiver City Girls ZeroMegan McDuffeeSeriesKunio-kunPlatform(s)Super FamicomNintendo SwitchPlayStation 4PlayStation 5WindowsXbox OneXbox Series X/SReleaseSuper FamicomJP: April 29, 1994River City Girls ZeroNintendo SwitchWW: February 14,...

Kembali kehalaman sebelumnya