Usr
   HOME

TheInfoList



OR:

In Unix and operating systems inspired by it, the
file system In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
is considered a central component of the operating system. 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. 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 A mouse ( : mice) is a small rodent. Characteristically, mice are known to have a pointed snout, small rounded ears, a body-length scaly tail, and a high breeding rate. The best known mouse species is the common house mouse (''Mus musculus' ...
. 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. Instead of addressing separate volumes such as
disk partitions Disk partitioning or disk slicing is the creation of one or more regions on Computer data storage#Secondary storage, secondary storage, so that each region can be managed separately. These regions are called partitions. It is typically the first ...
, 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. 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
inode The inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block locations of the object's data. File-system object attribute ...
s, which in turn contain both the file and its
metadata Metadata is "data that provides information about other data", but not the content of the data, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive metadata – the descriptive ...
(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 In computing, a hard link is a directory entry (in a directory-based file system) that associates a name with a file. Thus, each file must have at least one hard link. Creating additional hard links for a file makes the contents of that file acc ...
''. 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.)


File types

The original Unix file system supported three types of files: ordinary files, directories, and "special files", also termed device files. The
Berkeley Software Distribution The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
(BSD) and System V each added a file type to be used for interprocess communication: BSD added sockets, 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. Symlinks were modeled after a similar feature in Multics, 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.


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; subsequent versions, derivatives and clones typically have a similar man page. 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 Intel Binary Compatibility Standard (iBCS) is a standardized application binary interface (ABI) for Unix operating systems on Intel-386-compatible computers, published by AT&T, Intel and SCO in 1988, and updated in 1990. It extends source-leve ...
, the Common Operating System Environment, and
Linux Foundation The Linux Foundation (LF) is a non-profit technology consortium founded in 2000 as a merger between Open Source Development Labs and the Free Standards Group to standardize Linux, support its growth, and promote its commercial adoption. Additi ...
's
Filesystem Hierarchy Standard The Filesystem Hierarchy Standard (FHS) is a reference describing the conventions used for the layout of a UNIX system. It has been made popular by its use in Linux distributions, but it is used by other UNIX variants as well. It is maintained b ...
(FHS). Here is a generalized overview of common locations of files on a Unix operating system:


See also

* Btrfs * ext2 * ext3 * ext4 *
Filesystem Hierarchy Standard The Filesystem Hierarchy Standard (FHS) is a reference describing the conventions used for the layout of a UNIX system. It has been made popular by its use in Linux distributions, but it is used by other UNIX variants as well. It is maintained b ...
*
HAMMER A hammer is a tool, most often a hand tool, consisting of a weighted "head" fixed to a long handle that is swung to deliver an impact to a small area of an object. This can be, for example, to drive nails into wood, to shape metal (as w ...
* JFS (file system) * Unix File System * Veritas File System *
ZFS ZFS (previously: Zettabyte File System) is a file system with volume management capabilities. It began as part of the Sun Microsystems Solaris operating system in 2001. Large parts of Solaris – including ZFS – were published under an open ...


References

* {{DEFAULTSORT:Unix Directory Structure Unix file system technology File system management