3.4.6 Understanding Basic Linux Directories
|
Directory is group of files. Directory is divided into two types:
-
Root director y - There is only one root directory in your system, which is denoted by / (forward slash). It is root of your entire file system and cannot be renamed or deleted.
-
Sub directory - Directory under root (/) directory is subdirectory which can be created, ren amed by the user.
Directories are used to organize your data files, programs more efficiently
Everything starts from the root directory, represented by '/', and then expands into sub-directories. Linux places all the partitions under the root directory by 'mounting' them under specific directories. Closest to root under Windows would be c:.
Under Windows, the various partitions are detected at boot and assigned a drive letter. Under Linux, unless you mount a partition or a device, the system does not know of the existence of that partition or device. This might not seem to be the easiest way to provide access to your partitions or devices but it offers great flexibility.
We now move on to the layout or the directory structure of the Linux file system. Given below is the result of a 'ls -p' in the root directory.
Directory
|
Content
|
/
|
The root directory, starting point
|
/bin
|
This directory contains several useful commands that are used by both the system administrator as well as non-privileged users. This directory usually contains the shells like bash, csh etc. as well as much used commands like cp, mv, rm, cat, ls
|
/boot
|
This directory contains the system.map file as well as the Linux kernel. Lilo places the boot sector backups in this directory. It requires for system start-up
|
/dev
|
This is a very interesting directory that highlights devices like hda1, hda2 etc, which represent the various partitions on the first master drive of the system. /dev/cdrom and /dev/fd0 represent CDROM drive and floppy drive. /dev/dsp, file represents speaker device. So any data written to this file will be re-directed to speaker.
|
/etc
|
Most important system configuration files are in this directory contains data similar to those in the Control Panel in Windows
|
/home
|
Linux is a multi-user environment so each user is also assigned a specific directory which is accessible only to them and the system administrator. These are the user home directories, which can be found under /home/username
|
/lib
|
Shared Library files, Kernel modules.
|
/mnt
|
Standard mount point for external file systems, e.g. a CD-ROM or a digital camera.
|
/opt
|
Add-on software packages
|
/root
|
The administrative user's home directory
|
/sbin
|
System commands, generally accessible to administrator
|
/tmp
|
Temporary space for use by the system
|
/usr
|
This is one of the most important directories in the system as it contains all the user binaries. X and its supporting libraries can be found here. User programs like telnet, ftp etc are also placed here. /usr/doc contains useful system documentation. /usr/src/linux contains the source code for the Linux kernel.
|
/var
|
Storage for all variable files and temporary files created by users, such as log files, the mail queue, the print spooler area, space for temporary storage of files downloaded from the Internet.
|
|