logo
Linux User
OpenSource Apache Embedded C Linux MySQL Perl PHP Samba

Module Release March 2003: Logical Filesystem Structures

This month's offering is primarily about locating and placing files correctly. LPI 101 objective 2.4.8 requires you to:

Understand the filesystem hierarchy standard, know standard file locations, know the purpose of various system directories, find commands and files.

The File Hierarchy Standard (FHS) started out as an attempt to standardise Linux filesystem layouts, enabling developers to write software which didn't need configuration tweaks for each individual Linux distribution while providing users with a more consistent and comprehensible file structure. It has been remarkably successful, with most serious Linux distributors promising compliance. It is now been extended to apply to all Unix-like operating systems.

This module begins by explaining the data components in any Unix filesystem, e.g., explaining the different ways in which sharable, non-sharable, static and dynamic data need to be treated and located.

It then goes on to describe and explain the recommended locations for particular types of files under the FHS, e.g., /bin for general programs, /sbin for system administrator programs, /usr/X11R6 for X window system files, /usr/local for software compiled from source code, /usr/src for kernel sourc code, /var/run for process ID files, /var/mail or /var/spool/mail for mail queues, /var/log for log files, /etc for configuration files /mnt for temporarily mounted filesystems, /boot for files used by Lilo to boot the system, /dev for device files, and a host others that there isn't room to list here.

Having identified where most categories of program should be found, the module goes on to detail the standard tools for locating individual files, e.g., using which and the $PATH environment variable to find runable programs, using the bash built-in type command to do a similar job but particularly useful for finding duplicate programs, using updatedb so that the locate command can find arbitrary files quickly, using whatis and apropos to locate man pages, etc. The find command is not dealt with in this module because it is already described in the introduction to the entire course.