Unix filesystem

Version 7 Unix filesystem layout: subdirectories of "/" and "/usr"
An overview of a Unix filesystem layout

In Unix and operating systems inspired by it, the file system is considered a central component of the operating system.[1] It was also one of the first parts of the system to be designed and implemented by Ken Thompson in the first experimental version of Unix, dated 1969.[2]

As in other operating systems, the filesystem provides information storage and retrieval, and one of several forms of interprocess communication, in that the many small programs that traditionally form a Unix system can store information in files so that other programs can read them, although pipes complemented it in this role starting with the Third Edition. Also, the filesystem provides access to other resources through so-called device files that are entry points to terminals, printers, and mice.

The rest of this article uses Unix as a generic name to refer to both the original Unix operating system and its many workalikes.

Principles

The filesystem appears as one rooted tree of directories.[1] Instead of addressing separate volumes such as disk partitions, removable media, and network shares as separate trees (as done in DOS and Windows: each drive has a drive letter that denotes the root of its file system tree), such volumes can be mounted on a directory, causing the volume's file system tree to appear as that directory in the larger tree.[1] The root of the entire tree is denoted /.

In the original Bell Labs Unix, a two-disk setup was customary, where the first disk contained startup programs, while the second contained users' files and programs. This second disk was mounted at the empty directory named usr on the first disk, causing the two disks to appear as one filesystem, with the second disk’s contents viewable at /usr.

Unix directories do not contain files. Instead, they contain the names of files paired with references to so-called inodes, which in turn contain both the file and its metadata (owner, permissions, time of last access, etc., but no name). Multiple names in the file system may refer to the same file, a feature termed a hard link.[1] The mathematical traits of hard links make the file system a limited type of directed acyclic graph, although the directories still form a tree, as they typically may not be hard-linked. (As originally envisioned in 1969, the Unix file system would in fact be used as a general graph with hard links to directories providing navigation, instead of path names.[2])

File types

The original Unix file system supported three types of files: ordinary files, directories, and "special files", also termed device files.[1] The Berkeley Software Distribution (BSD) and System V each added a file type to be used for interprocess communication: BSD added sockets,[3] while System V added FIFO files.

BSD also added symbolic links (often termed "symlinks") to the range of file types, which are files that refer to other files, and complement hard links.[3] Symlinks were modeled after a similar feature in Multics,[4] and differ from hard links in that they may span filesystems and that their existence is independent of the target object. Other Unix systems may support additional types of files.[5]

Conventional directory layout

Certain conventions exist for locating some kinds of files, such as programs, system configuration files, and users' home directories. These were first documented in the hier(7) man page since Version 7 Unix;[6] subsequent versions, derivatives and clones typically have a similar man page.[7][8][9][10][11][12]

The details of the directory layout have varied over time. Although the file system layout is not part of the Single UNIX Specification, several attempts exist to standardize (parts of) it, such as the System V Application Binary Interface, the Intel Binary Compatibility Standard, the Common Operating System Environment, and Linux Foundation's Filesystem Hierarchy Standard (FHS).[13]

Here is a generalized overview of common locations of files on a Unix operating system:

Directory or file Description
/ The slash / character alone denotes the root of the filesystem tree.
/bin
Stands for binaries and contains certain fundamental utilities, such as ls or cp, that are needed to mount /usr, when that is a separate filesystem, or to run in one-user (administrative) mode when /usr cannot be mounted. In System V.4, this is a symlink to /usr/bin. Otherwise, it needs to be on the root filesystem itself.
/boot
Contains all the files needed for successful booting process. In Research Unix, this was one file rather than a directory.[14] Nowadays usually on the root filesystem itself, unless the system, bootloader etc. require otherwise.
/dev
Stands for devices. Contains file representations of peripheral devices and pseudo-devices. See also: Linux Assigned Names and Numbers Authority. Needs to be on the root filesystem itself.
/etc
Contains system-wide configuration files and system databases; the name stands for et cetera[14] but now a better expansion is editable-text-configurations. Originally also contained "dangerous maintenance utilities" such as init,[6] but these have typically been moved to /sbin or elsewhere. Needs to be on the root filesystem itself.
/home
Contains user home directories on Linux and some other systems. In the original version of Unix, home directories were in /usr instead.[15] Some systems use or have used different locations still: macOS has home directories in /Users, older versions of BSD put them in /u, FreeBSD has /usr/home.
/lib
Originally essential libraries: C libraries, but not Fortran ones.[14] On modern systems, it contains the shared libraries needed by programs in /bin, and possibly loadable kernel module, device drivers or binary blobs. Linux distributions may have variants /lib32 and /lib64 for multi-architecture support.
/media
Default mount point for removable devices, such as USB sticks, media players, etc. By common sense, the directory itself, whose subdirectories are mountpoints, is on the root partition itself.
/mnt
Stands for mount. Empty directory commonly used by system administrators as a temporary mount point. By common sense, the directory itself, whose subdirectories are mountpoints, is on the root partition itself.
/opt
Contains locally installed software. Originated in System V, which has a package manager that installs software to this directory (one subdirectory per package).[16]
/proc
procfs virtual filesystem showing information about processes as files.
/root
The home directory for the superuser root - that is, the system administrator. This account's home directory is usually on the initial filesystem, and hence not in /home (which may be a mount point for another filesystem) in case specific maintenance needs to be performed, during which other filesystems are not available. Such a case could occur, for example, if a hard disk drive suffers failures and cannot be properly mounted.
/sbin
Stands for "system (or superuser) binaries" and contains fundamental utilities, such as init, usually needed to start, maintain and recover the system. Needs to be on the root partition itself.
/srv
Server data (data for services provided by system).
/sys
In some Linux distributions, contains a sysfs virtual filesystem, containing information related to hardware and the operating system. On BSD systems, commonly a symlink to the kernel sources in /usr/src/sys.
/tmp
A place for temporary files not expected to survive a reboot. Many systems clear this directory upon startup or use tmpfs to implement it.
/unix
The Unix kernel in Research Unix and System V.[14] With the addition of virtual memory support to 3BSD, this got renamed /vmunix.
/usr
The "user file system": originally the directory holding user home directories,[15] but already by the Third Edition of Research Unix, ca. 1973, reused to split the operating system's programs over two disks (one of them a 256K fixed-head drive) so that basic commands would either appear in /bin or /usr/bin.[17] It now holds executables, libraries, and shared resources that are not system critical, such as the X Window System, window managers, scripting languages, etc. In older Unix systems, user home directories might still appear in /usr alongside directories containing programs, although by 1984 this depended on local customs.[14]
/usr/include
Stores the development headers used throughout the system. Header files are mostly used by the #include directive in C language, which historically is how the name of this directory was chosen.
/usr/lib
Stores the needed libraries and data files for programs stored within /usr or elsewhere.
/usr/libexec
Holds programs meant to be executed by other programs rather than by users directly. E.g., the Sendmail executable may be found in this directory.[18] Not present in the FHS until 2011;[19] Linux distributions have traditionally moved the contents of this directory into /usr/lib, where they also resided in 4.3BSD.
/usr/local
Resembles /usr in structure, but its subdirectories are used for additions not part of the operating system distribution, such as custom programs or files from a BSD Ports collection. Usually has subdirectories such as /usr/local/lib or /usr/local/bin.
/usr/share
Architecture-independent program data. On Linux and modern BSD derivatives, this directory has subdirectories such as man for manpages, that used to appear directly under /usr in older versions.
/var
Stands for variable. A place for files that might change frequently - especially in size, for example e-mail sent to users on the system, or process-ID lock files.
/var/log
Contains system log files.
/var/mail
The place where all incoming mail is stored. Users (other than root) can access their own mail only. Often, this directory is a symbolic link to /var/spool/mail.
/var/spool
Spool directory. Contains print jobs, mail spools and other queued tasks.
/var/src
The place where the uncompiled source code of some programs is.
/var/tmp
The /var/tmp directory is a place for temporary files which should be preserved between system reboots.

See also

References

  1. ^ a b c d e Ritchie, D.M.; Thompson, K. (July 1978). "The UNIX Time-Sharing System". Bell System Tech. J. 57 (6): 1905–1929. CiteSeerX 10.1.1.112.595. doi:10.1002/j.1538-7305.1978.tb02136.x.
  2. ^ a b Ritchie, Dennis M. (1979). The Evolution of the Unix Time-sharing System. Language Design and Programming Methodology Conf.
  3. ^ a b Leffler, Samuel J.; McKusick, Marshall Kirk; Karels, Michael J.; Quarterman, John S. (October 1989). The Design and Implementation of the 4.3BSD UNIX Operating System. Addison-Wesley. ISBN 978-0-201-06196-3.
  4. ^ McKusick, Marshall Kirk; et al. "A Fast Filesystem for Unix" (PDF). Freebsd.org. CSRG, UC Berkeley. Retrieved 16 November 2016.
  5. ^ stat(2) – Linux Programmer's Manual – System Calls
  6. ^ a b hier(7) – Version 7 Unix Programmer's Manual
  7. ^ hier(7) – FreeBSD Miscellaneous Information Manual
  8. ^ hier(7) – OpenBSD Miscellaneous Information Manual
  9. ^ "hier(7) man page for 2.9.1 BSD".
  10. ^ "hier(7) man page for ULTRIX 4.2".
  11. ^ "hier(7) man page for SunOS 4.1.3".
  12. ^ hier(7) – Linux Programmer's Manual – Overview, Conventions and Miscellanea
  13. ^ George Kraft IV (1 November 2000). "Where to Install My Products on Linux?". Linux Journal. Retrieved 13 November 2014.
  14. ^ a b c d e Kernighan, Brian W.; Pike, Rob (1984). The UNIX Programming Environment. Prentice-Hall. pp. 63–65. Bibcode:1984upe..book.....K.
  15. ^ a b Ritchie, Dennis. "Unix Notes from 1972". Retrieved 14 January 2018.
  16. ^ System V Application Binary Interface Edition 4.1 (1997-03-18)
  17. ^ M. D. McIlroy (1987). "A Research Unix reader: annotated excerpts from the Programmer's Manual, 1971–1986" (PDF). Bell Labs. CSTR 139.
  18. ^ "Chapter 7. sendmail". UNICOS/mp Networking Facilities Administration. Cray. Retrieved 14 September 2013.
  19. ^ "fhs-spec revision 44".

Read other articles:

K LineJenisPublik KKKode emitenTYO: 9107OSE: 9107Templat:NAGTemplat:Fukuoka Stock ExchangeIndustriTransportasiDidirikan1919; 105 tahun lalu (1919)PendiriKojiro MatsukataKantorpusatChiyoda-ku, Tokyo, JepangAnakusahaInternational Transportation ServiceSitus webwww.kline.co.jp Cerobong kapal K Line Vincent Thomas Bridge Peti kemas K Line sedang diangkut di Belgia Kawasaki Kisen Kaisha, Ltd. (川崎汽船株式会社code: ja is deprecated , Kawasaki Kisen Kabushiki-gaisha, disingkat K Line, ...

 

Armoracia Armoracia sisymbrioides Klasifikasi ilmiah Domain: Eukaryota Kerajaan: Plantae Upakerajaan: Trachaeophyta Divisi: Magnoliophyta Kelas: Magnoliopsida Ordo: Brassicales Famili: Brassicaceae Tribus: Cardamineae Genus: ArmoraciaG.Gaertn., B.Mey. & Scherb.[1] Spesies[2] Armoracia macrocarpa (Waldst. & Kit.) Kit. ex Baumg. Armoracia rusticana P.Gaertn., B.Mey. & Scherb. Armoracia sisymbrioides (DC.) N.Busch ex Ganesh Sinonim[3] Raphanis Moench Armoraci...

 

Millénaires : Ier millénaire • IIe millénaire • IIIe millénaire Siècles : XIe siècle • XIIe siècle • XIIIe siècle Décennies : 1100 • 1110 • 1120 • 1130 • 1140 1150 • 1160 • 1170 • 1180 • 1190 Années : 1101 • 1102 • 1103 • 1104 • 11051106 • 1107 • 1108 • 1109 • 1110 1111 • 1112 • 1113 • 1114 • 11151116 • 1117 • 1118 • 1119 • 1120 1121 • 1122 • 1123 • 1124 • 112...

American music and entertainment digital magazine PasteEditorJosh JacksonCategoriesOnline, American musicFrequencyDigital, monthlyPublisherPaste Media GroupFirst issueJuly 2002; 21 years ago (2002-07)Final issueAugust 31, 2010 (2010-08-31) (print)CountryUnited StatesBased in2852 E College Ave. Decatur, Georgia, U.S.[1]LanguageEnglishWebsitepastemagazine.comISSN1540-3106OCLC49937508 Paste is an American monthly music and entertainment digital magaz...

 

Indian tribe in California, United States Chicken Ranch Rancheria of Me-Wuk Indians of CaliforniaTotal population11[1]Regions with significant populations United States ( California)LanguagesEnglish,historically Central Sierra Miwok languageRelated ethnic groupsother Miwok tribes The Chicken Ranch Rancheria of Me-Wuk Indians of California is a federally recognized tribe of Miwok people in Tuolumne County, California.[1][2][3] The Chicken Ranch Rancher...

 

Australian politician Max OldmeadowOAMMember of the Australian Parliamentfor Division of HoltIn office2 December 1972 – 13 December 1975Preceded byLen ReidSucceeded byWilliam Yates Personal detailsBorn(1924-08-03)3 August 1924Melbourne, Victoria, AustraliaDied21 March 2013(2013-03-21) (aged 88)MelbournePolitical partyAustralian Labor PartyOccupationTeacher Maxwell Wilkinson Oldmeadow OAM (3 August 1924 – 21 March 2013) was an Australian politician.[1] Bo...

2023 Indian Tamil period crime thriller film Viduthalai Part 1Theatrical release posterDirected byVetrimaaranWritten byVetrimaaranB. JeyamohanBased onThunaivanby B. JeyamohanProduced byElred KumarStarringSooriVijay SethupathiBhavani SreGautham Vasudev MenonCinematographyR. VelrajEdited byR. RamarMusic byIlaiyaraajaProductioncompaniesRS InfotainmentGrass Root Film CompanyDistributed byRed Giant MoviesRelease date 31 March 2023 (2023-03-31)[1] Running time150 minutes[...

 

This article relies largely or entirely on a single source. Relevant discussion may be found on the talk page. Please help improve this article by introducing citations to additional sources.Find sources: The Phantom of Manhattan – news · newspapers · books · scholar · JSTOR (December 2016) The Phantom of Manhattan First edition (UK)AuthorFrederick ForsythCountryUnited KingdomLanguageEnglishGenreThriller, Mystery, RomancePublisherBantam Books (UK)St. ...

 

† Человек прямоходящий Научная классификация Домен:ЭукариотыЦарство:ЖивотныеПодцарство:ЭуметазоиБез ранга:Двусторонне-симметричныеБез ранга:ВторичноротыеТип:ХордовыеПодтип:ПозвоночныеИнфратип:ЧелюстноротыеНадкласс:ЧетвероногиеКлада:АмниотыКлада:Синапсиды�...

District in Baden-Württemberg, GermanySigmaringenDistrict FlagCoat of armsCountryGermanyStateBaden-WürttembergAdm. regionTübingenCapitalSigmaringenGovernment • District admin.Stefanie Bürkle (CDU)Area • Total1,204.35 km2 (465.00 sq mi)Population (31 December 2022)[1] • Total134,045 • Density110/km2 (290/sq mi)Time zoneUTC+01:00 (CET) • Summer (DST)UTC+02:00 (CEST)Vehicle registrationSIG, SLG, STO,...

 

Baseball statistic 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: Passed ball – news · newspapers · books · scholar · JSTOR (May 2019) (Learn how and when to remove this message) Rob Bowen (right) of the Minnesota Twins allows a pitch to deflect off his glove during a 2006 spring training game In baseball, ...

 

Traditional Korean holiday This article is about the festival and national holiday of Korea observed on the Korean calendar. For other traditions of celebrating the lunar New Year in other regions of Asia, see Lunar New Year. Seol redirects here. For the surname, see Seol (surname). SeollalKoreans wearing hanbok and playing yut during Seollal.Also calledSeollal, Lunar New YearObserved byKorean people around the worldTypeCulturalSignificanceFirst day of the lunisolar calendarDateTypically...

Synagogue in Hong Kong 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: Ohel Leah Synagogue – news · newspapers · books · scholar · JSTOR (October 2010) (Learn how and when to remove this message) Ohel Leah Synagogueבית הכנסת אהל לאהBeit Ha-Knesset Ohel Leah猶太教莉亞堂Exterior of the Ohel...

 

Former NATO Supreme Commander Allied Command AtlanticACLANT Emblem.Active30 January 1952 – 19 June 2003CountryNATOSizeCommandHeadquartersNorfolk, VirginiaNickname(s)SACLANTEngagementsCold WarMilitary unit The Supreme Allied Commander Atlantic (SACLANT) was one of two supreme commanders of the North Atlantic Treaty Organisation (NATO), the other being the Supreme Allied Commander Europe (SACEUR). The SACLANT led Allied Command Atlantic was based at Norfolk, Virginia. The entire command was r...

 

Mound formed on a retreating glacier and deposited on land For other uses, see Kame (disambiguation). A kame near Kirriemuir, Scotland A kame in Yellowstone National Park, Wyoming A kame among the glacial drift on the terminal moraine of the Okanagan Lobe of the Cordilleran Ice Sheet on the Waterville Plateau of the Columbia Plateau in Washington A kame, or knob, is a glacial landform, an irregularly shaped hill or mound composed of sand, gravel and till that accumulates in a depression on a ...

Questa voce sugli argomenti calciatori francesi e calciatori guineani è solo un abbozzo. Contribuisci a migliorarla secondo le convenzioni di Wikipedia. Segui i suggerimenti dei progetti di riferimento 1, 2. Antoine Conte Conte nel 2023 Nazionalità  Francia Guinea (dal 2022) Altezza 179 cm Peso 72 kg Calcio Ruolo Difensore Squadra  Botev Plovdiv CarrieraGiovanili 2007-2012 Paris Saint-GermainSquadre di club1 2012-2013 Paris Saint-Germain 213 (0)2013 Paris...

 

British economist and politician (1772–1823) For other people named David Ricardo, see David Ricardo (disambiguation). The Right HonourableDavid RicardoPortrait by Thomas Phillips, c. 1821Member of Parliament for PortarlingtonIn office20 February 1819 – 11 September 1823Preceded byRichard SharpSucceeded byJames Farquhar Personal detailsBorn(1772-04-18)18 April 1772London, EnglandDied11 September 1823(1823-09-11) (aged 51)Gatcombe Park, Gloucestershire, EnglandPolitical party...

 

Ottoman historian, jurist and poet (1469–1534) al-Mu'allim al-Awwal (The First Teacher)[1]Ibn KemalPersonalBornŞemseddin Ahmed1468Edirne, Rumelia, Ottoman EmpireDied14 April 1534(1534-04-14) (aged 65–66)Istanbul, Ottoman EmpireReligionIslamEra15th-centuryDenominationSunniJurisprudenceHanafiCreedMaturidi[2]Main interest(s)Aqidah, Tafsir, Tasawwuf, Hadith, Fiqh, Usul, Ma'aani, Mantiq, Falsafa, Ottoman historyNotable work(s)Tevarih-i Al-i Osman (The Chronicles of the Ho...

Jody Williams Jody Williams (lahir 9 Oktober 1950) ialah seorang guru dan pekerja sosial Amerika Serikat yang menerima Hadiah Nobel Perdamaian 1997 bersama dengan gerakan yang dipimpinnya, International Campaign to Ban Landmines (ICBL) (Kampanye Internasional untuk Melarang Ranjau Darat). Williams mula-mula belajar sebagai guru English as a Second Language (ESL). Ia menerima gelar BA dari Universitas Vermont pada 1972 dan gelar magister dalam mengajar bahasa Spanyol dan ESL dari School for In...

 

التقسم الإداري لقضاء العمارة قضاء العمارة وهو أحد أقضية محافظة ميسان في العراق ويحتل الموقع الأوسط منها ويعتبر مركز المحافظة إذ تبلغ مساحته الكلية حوالي 6474 كيلو متر مربع ويشكل نسبة قدرها ( 40,3% ) من مساحة المحافظة وتتبع له اداريا ناحيتي كميت و المشرح ويقدر عدد سكان القضاء بح�...