Linux File System Structure

Root Directory ( / )

–Top of the file system. Similar to \ in DOS

/bin

–Contain the binary (executable code) of most essential Linux commands, e.g. bash, cat, cp, ln, ls, etc.

/boot

–Contain all the files needed to boot the Linux system, including the binary of the Linux kernel. E.g., on Red Hat Linux 6.1, the kernel is in /boot/vmlinux-2.2.5-15 file

/dev

–Contain the special files for devices, e.g. fd0, hd0, etc.

/etc

–Contain host-specific files and directories, e.g. information about system configuration

–/etc/passwd

–This file contains login information of users in the system

–For every user, one line of record is stored in the following format:

login_name : dummy_or_encrypted_password : user_ID : group_ID : user_info : home_directory : login_shell

lE.g. davis:x:134:105:James A Davis:/home/davis:/bin/bash

–davis : login name

–x : means that it is a dummy password. The encrypted password is stored in /etc/shadow. This field can also be used to store the actual encrypted password. In any case, the original (unencrypted) password cannot be seen by anyone, including the administrator

–134 : a user id given to that user. Range from 0 to 65535. 0 is assigned to super-user. 1 to 99 are reserved

–105 : a group id given to that user to indicate which group he belongs to. Range from 0 to 65535. 0 to 99 reserved

–James A Davis : user info, usually user’s full name

–/home/davis : home directory of the user

–/bin/bash : the location of the shell the user is using

/home

–Contain the home directories of every user in the system, e.g. dlun, guest, etc

/lib

–Store all essential libraries for different language compilers

/lost+found

–Contain all the files on the system not connected to any directory.

–System administrator should determine the fate of the files in this directory

/mnt

–Use by system administrator to mount file systems temporarily by using the mount command

–Before using any devices, they have to be mounted to the system for registration

–For example, after mounting a CD-ROM, the file system in it will be mapped to /mnt/cdrom directory

–User can then read and write files in the CD-ROM by accessing this directory

–Similar to mapping a drive letter to a CD-ROM in Windows

–Different from the special file in /dev. Special file is only a place where data of the CD-ROM is transferred or stored. No file system concept

/opt

–Use to install add-on software packages, e.g. star office, etc.

/proc

–Contain process and system information

/root

–Home directory of the user root, usually the administrator

/sbin

–The directories /sbin, /usr/sbin, and /usr/local/sbin contain system administration tools, utilities and general root only commands, such as halt, reboot and shutdown

/tmp

–Contain temporary files. Usually files in this directory will be deleted from time to time to avoid the system fills with temp files

/usr

–One of the largest sections of the Linux file system

–Contain read-only data that are shared between various users, e.g. the manual pages needed for the command man. Stored in /usr/man direcrtory

/var

–Contain data that keeps on changing as the system is running. E.g. /var/spool/mail directory keeps the mail of user

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s