Introduction to UNIX files
In UNIX systems any element is represented in the form of a file. All files are architectured around a single tree structure where the base, called the root, is written "/".
File types
UNIX systems define different file types:
- Physical files, entered on the hard disk. This is a file in the generally understood sense of the word;
- Directories are files (nodes) of the tree structure able to contain files or other directories. A directory contains at least a parent directory (written ..), relating to the directory at the higher level, and a current directory (written .), i.e. itself;
- Links are special files enabling several names (links) to be associated to a single and same file. This system makes it possible to have several instances of the same file in several places in the tree structure without needing to copy it, which in particular helps to ensure maximum coherence and save on disk space. There are two types of links:
- Virtual files do not really exist because they only exist in the memory. These files, located in particular in the /proc directory contain information about the system (processor, memory, hard disks, processes, etc.);
- The Device files located in the /dev/ directory relate to the system devices. This concept may be disconcerting for a new user for the first time.
The concept of mount points
Files in a UNIX system are organised into a single tree structure. It is however possible to have several partitions using a mechanism called mounting which makes it possible to connect a partition to a directory in the main tree structure. So, the fact of mounting a partition in the directory /mnt/partition makes all the files in the partition accessible from this directory, called the "mount point".
File hierarchy under Unix
To ensure compatibility and portability, UNIX systems comply with the FHS (File Hierarchy Standard) standard. The basic hierarchy of a Unix system is as follows:
| / | | | | the root, containing the main directories |
| /bin | | | Contains the executables necessary for the system, used by all users. |
| /boot | | | Contains the loading files for the kernel, including the bootstrap loader. |
| /dev | | | Contains entry points for the devices. |
| /etc | | | Contains the configuration files required for the administration of the system (files passwd, group, inittab, ld.so.conf, lilo.conf, etc.) |
| | /etc/X11 | | contains specific files for the configuration of X (contains XF86Config, for example) |
| /home | | | Contains the users' personal directories. Insofar as the directories located under /home are intended to host the user files for the system, you are advised to dedicate a specific partition to the /boot directory in order to limit damage in the case of disk space saturation. |
| /lib | | | Contains standard libraries shared between the system's different applications. |
| /mnt | | | Makes it possible to host the mount points of temporary partitions (CD-Rom, floppy disk, etc.) |
| /proc | | | Merges a collection of virtual files making it possible to obtain information about the system or processes being executed. |
| /root | | | Root administrator's personal directory. The administrator's personal directory is located apart from the other personal directories because it is located in the root partition so as to be able to be loaded at the start, before the mounting of the /home partition. |
| /sbin | | | Contains essential system executables (for example the command adduser). |
| /tmp | | | contains temporary files |
| /usr | | | Secondary hierarchy |
| | /usr/X11R6 | | this directory is reserved for system X version 11 release 6 |
| | /usr/X386 | | used before by X version 5, this is a symbolic link to /usr/X11R6 |
| | /usr/bin | | contains the majority of binary files and user commands |
| | /usr/include | | contains header files for the programs C and C++ |
| | /usr/lib | | contains most of the shared libraries for the system |
| | /usr/local | | contains data relating to the programs installed on the local machine by the root |
| | | /usr/local/bin | Binaries for local programs |
| | | /usr/local/include | Local C and C++ header files |
| | | /usr/local/lib | Shared local libraries |
| | | /usr/local/sbin | Local system binaries |
| | | /usr/local/share | Independent hierarchy |
| | | /usr/local/src | Local source files |
| | /usr/sbin | | contains binary files not essential for the system that are reserved for the system administrator |
| | /usr/share | | reserved for non-dependent data of the architecture |
| | /usr/src | | contains source code files |
| /var | | | contains changeable data such as database files, logs, files for the print spooler or even waiting emails. |
|
Last update on Thursday October 16, 2008 02:43:15 PM