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:

CentraleSupélec CentraleSupélec adalah sekolah teknik lulusan Perancis Universitas Paris-Saclay di Gif-sur-Yvette, Perancis. Ia ditubuhkan pada 1 Januari 2015, sebagai hasil penggabungan strategik antara dua grandes écoles yang berprestij di Perancis, École Centrale Paris dan Supélec. Ia adalah salah satu anggota konstituen Universitas Paris-Saclay.[1] Ia adalah anggota pengasas utama Universitas Paris-Saclay, rangkaian TIME (Pengurus Industri Terbaik untuk Eropah) dan juga persatua…

By Quantum Physics: A Nightlife VenturePoster filmNama lainHangul양자물리학 Alih Aksara yang DisempurnakanYang-ja-Mul-li-hak SutradaraLee Seong-taeProduser Kim Young-min Kim Sang-su Ditulis olehLee Seong-taePemeran Park Hae-soo Seo Yea-ji Kim Sang-ho Kim Eung-soo Byun Hee-bong Kim young-jae Lee Chang-hoon PerusahaanproduksiMCMCDistributorFinecut Co., Ltd.Tanggal rilis 15 September 2019 (2019-09-15) (Korea Selatan) Durasi119 menit [1]NegaraKorea SelatanBahasaKorea By Q…

Katedral Havana Katedral Camagüey Ini adalah daftar katedral di Kuba. Katolik Katedral Gereja Katolik di Kuba:[1] Katedral Perawan Candelaria di Camagüey Katedral Santo Eugenius de la Palma di Ciego de Avila Katedral Bunda Maria Yang Dikandung Tanpa Noda di Cienfuegos Katedral Santa Katarina dari Ricci di Guantánamo Kon-katedral Bunda Maria Diangkat ke Surga di Baracoa Katedral Santo Isidorus di Holguín Katedral Santo Carolus Borromeus di Matanzas Katedral San Rosendo di Pinar del R…

Orang tua yang mengenakan baji. Baji (바지) adalah jenis celana tradisional Korea, bagian dari hanbok.[1][2] Baji berbentuk menggelembung sehingga harus diikatkan ke pinggang dengan kain pengikat.[1] Selain longgar, pada pergelangan kaki, baji akan melebihi batas, sehingga diikatkan dengan menggunakan pengikat yang dinamakan daenim.[1] Sejarah Baji dikenakan oleh pria dan wanita sejak era Tiga Kerajaan. Lukisan di dinding makam kuno Tiga Kerajaan menggambarkan k…

Type of field-effect transistor OFET-based flexible display Organic CMOS logic circuit. Total thickness is less than 3 μm. Scale bar: 25 mm An organic field-effect transistor (OFET) is a field-effect transistor using an organic semiconductor in its channel. OFETs can be prepared either by vacuum evaporation of small molecules, by solution-casting of polymers or small molecules, or by mechanical transfer of a peeled single-crystalline organic layer onto a substrate. These devices have been dev…

Part of a series onBritish law Acts of Parliament of the United Kingdom Year      1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879…

Peruta v. San Diego CountyCourtUnited States Court of Appeals for the Ninth CircuitFull case nameEdward Peruta et al v. County of San Diego et al.DecidedJune 9, 2016Citation(s)824 F.3d 919Case historyPrior history Peruta v. Cty. of San Diego, 758 F. Supp. 2d 1106 (S.D. Cal. 2010), reversed, 742 F.3d 1144 (9th Cir. 2014) Richards v. Cty. of Yolo, 821 F. Supp. 2d 1169 (E.D. Cal. 2011), reversed, 742 F.3d 1144 (9th Cir. 2014) Subsequent historyCert. denied, 137 S. Ct. 1995 (2017).Court membershipJu…

Jean HersholtHersholt pada 1929LahirJean Pierre Carl Buron[1](1886-07-12)12 Juli 1886Copenhagen, DenmarkMeninggal2 Juni 1956(1956-06-02) (umur 69)Hollywood, California, Amerika SerikatMakamForest Lawn Memorial Park, Glendale, CaliforniaNama lainJean Pierre Hersholt Jean Buron HersholtPekerjaanPemeranTahun aktif1906–1955Suami/istriVia Hersholt ​(m. 1914)​Anak2 putra Jean Pierre Carl Buron (12 Juli 1886 – 2 Juni 1956), yang lebi…

Cet article est une ébauche concernant une localité italienne et le Trentin-Haut-Adige. Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants. Isera Administration Pays Italie Région Trentin-Haut-Adige  Province Trentin   Code postal 38060 Code ISTAT 022098 Code cadastral E334 Préfixe tel. 0464 Démographie Gentilé iserotti Population 2 785 hab. (1er janvier 2023[1]) Densité 199 hab./km2 Géo…

Colomby-Anguerny L'église Saint-Martin à Anguerny. Administration Pays France Région Normandie Département Calvados Arrondissement Caen Intercommunalité Communauté de communes Cœur de Nacre Maire Mandat Jean-Luc Guillouard 2020-2026 Code postal 14610 Code commune 14014 Démographie Populationmunicipale 1 306 hab. (2021) Densité 233 hab./km2 Géographie Coordonnées 49° 15′ 57″ nord, 0° 23′ 54″ ouest Altitude Min. 19 mMax. 69…

Pigment-bearing organelle in plant cells The coloration of the petals and sepals on the bee orchid is controlled by chromoplasts. Chromoplasts are plastids, heterogeneous organelles responsible for pigment synthesis and storage in specific photosynthetic eukaryotes.[1] It is thought that like all other plastids including chloroplasts and leucoplasts they are descended from symbiotic prokaryotes.[2] Function Chromoplasts are found in fruits, flowers, roots, and stressed and aging …

Milentija Popovića L'hôtel Hyatt Regency Belgrade, au n° 5 Situation Coordonnées 44° 48′ 47″ nord, 20° 26′ 04″ est Pays Serbie Ville Belgrade Quartier(s) Novi Beograd Début Bulevar Mihaila Pupina Fin Bulevar Milutina Milankovića Morphologie Type Rue Géolocalisation sur la carte : Serbie modifier  La rue Milentija Popovića (en serbe cyrillique : Милентија Поповића) est située à Belgrade, la capitale de la Serbie, da…

Державний комітет телебачення і радіомовлення України (Держкомтелерадіо) Приміщення комітетуЗагальна інформаціяКраїна  УкраїнаДата створення 2003Керівне відомство Кабінет Міністрів УкраїниРічний бюджет 1 964 898 500 ₴[1]Голова Олег НаливайкоПідвідомчі орг…

Pour les articles homonymes, voir Louvigny. Cet article est une ébauche concernant une commune de la Sarthe. Vous pouvez partager vos connaissances en l’améliorant (comment ?). Le bandeau {{ébauche}} peut être enlevé et l’article évalué comme étant au stade « Bon début » quand il comporte assez de renseignements encyclopédiques concernant la commune. Si vous avez un doute, l’atelier de lecture du projet Communes de France est à votre disposition pour vous aider.…

GMMTVSebelumnyaGrammy TelevisionJenisLimitedIndustriProduksi televisiDidirikan3 Agustus 1995; 28 tahun lalu (1995-08-03)Kantorpusat30th Floor of GMM Grammy Place, Bangkok, ThailandTokohkunciSataporn PanichraksapongInduk GMM Grammy GMM Channel Holding Situs webwww.gmm-tv.com GMMTV (Thai: จีเอ็มเอ็มทีวีcode: th is deprecated , RTGS: Chi em em thiwi, atau sebelumnya bernama Grammy Television) adalah anak perusahaan konglomerat hiburan Thailand GMM Grammy, di bawah T…

2002 song by A1 Learn to FlySong by A1from the album Make It Good ReleasedNovember 2002Length3:47LabelSony BMGSongwriter(s) Peter Gordeno Rick Mitra Christian Ingebrigtsen Chris Porter Producer(s)Mike Hedges Learn to Fly is a song originally recorded by British boyband A1, due to be released as the fourth single from the group's third studio album, Make It Good. Written by band member Christian Ingebrigtsen, along with Peter Gordeno, Chris Porter and Rick Mitra, a single release was cancelled wh…

River in ItalyEraThe Era as it passes Pontedera.LocationCountryItalyPhysical characteristicsMouthArno • locationPontedera • coordinates43°39′57″N 10°38′00″E / 43.6658°N 10.6334°E / 43.6658; 10.6334Length54 km (34 mi)Basin featuresProgressionArno→ Tyrrhenian Sea The Era is a river in Tuscany in Italy. It rises near Volterra and flows into the Arno river at Pontedera. The Era is 54 km long, and its main …

Australian equipment and locomotive manufacturer Clyde EngineeringClyde Engineering Builder's plateNew South Wales D57 class locomotive in Junee in September 1961Company typepublicly listedTraded asASX: CLYIndustryEngineeringFoundedSeptember 1898Defunct15 July 1996SuccessorEvans Deakin Industries (1996–2001)Downer Rail (2001–present)HeadquartersNorth SydneyNumber of locationsGranvilleKelsoSomertonEagle FarmRosewaterSubsidiariesMartin & King Men at work in the aircraft workshop at Cl…

1863-1865 U.S. Congress 38th United States Congress37th ←→ 39thUnited States Capitol (1861)March 4, 1863 – March 4, 1865Members52 senators184 representatives10 non-voting delegatesSenate majorityRepublicanSenate PresidentHannibal Hamlin (R)House majorityRepublicanHouse SpeakerSchuyler Colfax (R)SessionsSpecial: March 4, 1863 – March 14, 18631st: December 7, 1863 – July 4, 18642nd: December 5, 1864 – March 3, 1865 The 38th United States Congress was a meeting of the leg…

Brand of flashlight This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (April 2013) (Learn how and when to remove this message) Maglite 2 D cell flashlight Maglite (also spelled Mag-Lite, stylized as MAG-LITE) is a brand of flashlight manufactured in the United States by Mag Instrument, Inc. located in Ontario, California, and founded by Anthony Maglica. It was intr…

Kembali kehalaman sebelumnya