What do you understand about the Unix File System
and Directory Structure?
Unix File System
A file system is a logical collection of files on a partition
or disk. A partition is a container for information and can span an entire
hard drive if desired.
Your hard drive can have various partitions which usually
contains only one file system, such as one file system housing the / file
system or another containing the /home file system.
One file system per partition allows for the logical maintenance
and management of differing file systems.
Everything in Unix is considered to be a file, including
physical devices such as DVD-ROMs, USB devices, floppy drives, and so forth.
Directory Structure:
Unix uses a hierarchical file system structure, much like
an upside-down tree, with root (/) at the base of the file system and all
other directories spreading from there.
A UNIX filesystem is a collection of files and directories
that has the following properties:
-
It has a root directory (/) that contains other files and
directories.
-
Each file or directory is uniquely identified by its name,
the directory in which it resides, and a unique identifier, typically called
an inode.
-
By convention, the root directory has an inode number of
2 and the lost+found directory has an inode number of 3. Inode numbers
0 and 1 are not used. File inode numbers can be seen by specifying the
-i option to ls command.
-
It is self contained. There are no dependencies between one
filesystem and any other.
The directories have specific purposes and generally hold
the same types of information for easily locating files. Following are
the directories that exist on the major versions of Unix:
Directory |
Description |
/ |
This is the root directory which should contain only
the directories needed at the top level of the file structure. |
/bin |
This is where the executable files are located. They
are available to all user. |
/dev |
These are device drivers. |
/etc |
Supervisor directory commands, configuration files, disk
configuration files, valid user lists, groups, ethernet, hosts, where to
send critical messages. |
/lib |
Contains shared library files and sometimes other kernel-related
files. |
/boot |
Contains files for booting the system. |
/home |
Contains the home directory for users and other accounts. |
/mnt |
Used to mount other temporary file systems, such as cdrom
and floppy for the CD-ROM drive and floppy diskette drive, respectively. |
/proc |
Contains all processes marked as a file by process number
or other information that is dynamic to the system. |
/tmp |
Holds temporary files used between system boots. |
/usr |
Used for miscellaneous purposes, or can be used by many
users. Includes administrative commands, shared files, library files, and
others. |
/var |
Typically contains variable-length files such as log
and print files and any other type of file that may contain a variable
amount of data. |
/sbin |
Contains binary (executable) files, usually for system
administration. For example fdisk and ifconfig utlities. |
/kernel |
Contains kernel files. |
|
Unix Tips
|