Structure of the Linux File System
The documents system in Linux OS, along with in Windows OS, is an ordered structure of directory sites as well as files (in the form of a tree), but it has a variety of primary distinctions.
Directory site structure
In Windows OS, hard disk drives are hired Latin letters (C:, D:, ...), and also each of the drives is an origin directory site with its own folder tree. Linking a new tool will certainly cause the appearance of a new origin directory with its very own letter (for instance, F:-RRB-. In Linux, the file system is represented by a solitary origin directory site, signified as a slash (/). As necessary, with an offered documents framework, not disks consist of directories, yet a directory contains disks.
Attaching outside media
Linux has a mount procedure: when a removable media or disk is attached, the device data will show up in the/ dev (devices) directory site. To see the contents of this gadget, it should be mounted in a separate/ mnt directory. Additionally, the data system permits you to place it to any other place, as an example/ residence.
The principle of "documents" in Linux has a slightly different definition than in Windows. "File" can be called a normal documents containing data and interpreted by the program. A directory is also a "data" having web links to various other directory sites or information documents. Gadget data describes the vehicle driver through which the system engages with physical devices. Many other kinds of data are also offered.
The principle of installing programs
If in Windows programs usually store all data in one folder, for instance in "C: Program FilesProgramName", after that in Linux program data are split right into directory sites relying on the type. For instance, executable documents in/ container, libraries in/ lib, arrangement data in/ and so on, logs and cache in/ var.
Register of names
Likewise worth noting is the case level of sensitivity of the Linux documents system. The documents Temp.txt and temp.txt will certainly be interpreted as various data as well as can be situated in the exact same directory site, unlike Windows, which does not compare instance names. The very same regulation applies to directory sites - names in different situations indicate different directories.
The objective of each directory site is managed by the "Filesystem Hierarchy Criterion" FHS (Filesystem Hierarchy Standard). Below we explain the main directory sites according to the FHS standard:
- / - root directory. Contains the entire hierarchy of the system;
- /bin - Binary executable files are located here. Basic general commands stored separately from other programs in the system (eg pwd, ls, cat, ps);
- /boot - files used to boot the system are located here (initrd image, vmlinuz kernel);
- / dev - this directory contains device (driver) files. These files allow you to interact with devices. For example, if it is a hard disk, you can connect it to the file system. You can write directly to a printer file and send a print job;
- /etc - this directory contains program configuration files. These files allow you to configure systems, services, system daemon scripts;
- /home is a directory similar to the Users directory in Windows. Contains the home directories of user accounts (other than root). When a new user is created, a directory of the same name with the same name is created here and stores the personal files of this user;
- /lib - contains system libraries with which programs and kernel modules work;
- /lost+found - contains files recovered after a system crash. The system will check after a failure and the found files can be viewed in this directory;
- /media - mount point for external media. For example, when you insert a disc into the drive, it will be automatically mounted to the /media/cdrom directory;
- /mnt - temporary mount point. Pluggable filesystems are usually mounted to this directory for temporary use;
- /opt - additional (optional) applications are located here. Such programs usually do not follow the accepted hierarchy and store their files in one subdirectory (binaries, libraries, configurations);
- /proc - contains files that store information about running processes and the state of the OS kernel;
- /root - a directory that contains files and personal settings of the superuser;
- /run - contains application state files. For example, PID files or UNIX sockets;
- /sbin - similarly, /bin contains binary files. Utilities are needed to configure and administer the system as a superuser;
- /srv - contains files of services provided by the server (eg FTP or Apache HTTP);
- /sys - contains data directly about the system. Here you can find information about the kernel, drivers and devices;
- /tmp - contains temporary files. These files are available to all users for reading and writing. Note that this directory is cleared on reboot;
- /usr - contains user applications and second-level utilities used by users, not by the system. The content is read-only (except for root). Instructions has a secondary hierarchy and is similar to the root;
- /var - contains variable files. Has subdirectories responsible for individual variables. For example, logs will be stored in /var/log, cache in /var/cache, job queues in /var/spool/ and so on.