Linux-Mandrake:
User Guide and
Reference Manual

MandrakeSoft

 
 
January 2000
http://www.linux-mandrake.com


Next : The Linux filesystem: ext2fs
Previous : Text Editing: Emacs and VI
Up

(Back to the table of contents)

Chapter 3 : Organization of the file tree


These days, a Unix system is big, very big, and that is particularly true with Linux: the profusion of software available would make it an unmanageable system if there were not guidelines for the location of files in the tree structure.

The acknowledged standard in this respect is FHS (Filesystem Hierarchy Standard), which is on version 2.0 at the time of writing of this manual. The document which describes the standard is available on the Internet in different formats at URL http://www.pathname.com/fhs/. This chapter gives only a brief summary, but it should be enough to teach you in what directory to look for (or place) a given file.

Shareable and unshareable, static and variable data

Data on a Unix system can be classified according to these two criteria. You will have guessed what they both mean: shareable data is data that can be common to several machines in a network, while unshareable data cannot be. Static data must not been modified in normal use, while variable data can be. As we explore the tree structure, we will classify the different directories into each of these categories.

Note that these classifications are only recommended. You are not obliged to follow them, but adopting these guidelines will greatly help you manage your system. Note, too, that the static/variable distinction only applies to the use of the system and not its configuration. If you install a program, you will obviously have to modify "normally" static directories, e.g. /usr.

The root directory: /

The root directory contains the whole system hierarchy. It cannot be classified since its subdirectories may or may not be static or shareable. Here is a list of the main directories and subdirectories:

/usr: the big one

The /usr directory is the main application storage directory. All the binary files in this directory must not be required for the system startup or maintenance, since the /usr hierarchy is very often a separate filesystem. Given its often large size, /usr has its own hierarchy of subdirectories. We will mention just a few:

There are also /usr/doc and /usr/man directories, which respectively contain application documentation and the system manual pages, but the standard recommends they be eventually moved to /usr/share.

/var: data modifiable during use

The /var directory contains all the operating data for programs running on the system. Unlike the working data in /tmp, these data must be kept intact on the event of a reboot. There are many subdirectories, and some are very useful:

/etc: configuration files

The /etc directory is one of the essential directories in any Unix system. It contains all the basic system configuration files. Please do not delete it to save space! Likewise, if you want to extend your tree structure over several partitions, remember that /etc must not be put on a separate partition: it is needed for system initialization.

Some important files are:

There are also certain subdirectories for programs which require large numbers of files for configuration. This applies to X Window System, for example, which has the whole /etc/X11 directory.


Next : The Linux filesystem: ext2fs
Previous : Text Editing: Emacs and VI
Up

Copyright � 2000 MandrakeSoft