Lecture # 9 - Linux File System
Linux File System, Structure, and Key Directories and their Purposes.
Table of contents
Linux File System and Structure:
The Linux file system, also known as the Linux directory structure or Linux filesystem hierarchy, is the organizational layout of files and directories on a Linux operating system. It follows a hierarchical structure and defines the locations and organization of various system and user files. Understanding the Linux file system is crucial for effectively navigating and managing files on a Linux system.
Key Directories with Purposes:
/ (Root Directory):
The root directory is the top-level directory in the Linux file system hierarchy.
It contains all other directories and files on the system.
In Linux, all paths start from the root directory (
/
).
/bin (Binary Binaries):
Contains essential binary executable files required for system boot and operation.
Common system utilities like
ls
,cp
,mv
,rm
, etc., are located here.
/boot:
Contains boot loader files and the Linux kernel.
Configuration files related to the boot process may also reside here.
/dev (Device Files):
Contains device files representing hardware devices and pseudo-devices.
Each device in Linux is represented as a file, allowing interaction with hardware through file operations.
/etc (Configuration Files):
Contains system-wide configuration files.
Configuration files for various services, applications, and system settings are stored here.
/home:
Home directories for regular users are typically located here.
Each user has their own subdirectory within
/home
where they can store personal files and configurations.
/lib and /lib64 (Libraries):
Contains shared libraries required by executable files in
/bin
and/sbin
./lib
typically contains 32-bit libraries, while/lib64
contains 64-bit libraries on 64-bit systems.
/media:
- Mount point for removable media devices such as USB drives, CDs, and DVDs.
/mnt (Mount Point):
A generic mount point for mounting filesystems temporarily.
Often used for mounting external or remote filesystems.
/opt (Optional):
Contains additional software packages installed on the system.
Typically used for installing software that is not part of the official distribution's package management system.
/proc (Process Information):
A virtual filesystem that provides information about processes and system resources.
Information is presented in a hierarchical structure resembling a directory tree.
/root:
Home directory for the root user (superuser).
Root user's personal files and configurations are stored here.
/sbin (System Binaries):
Contains essential system administration binaries.
Commands used for system administration tasks are located here.
/srv (Service Data):
Contains data files for services provided by the system.
Often used by web servers and other network services to store data served by the system.
/sys (System):
- A virtual filesystem that exposes kernel data structures and information about the system's hardware and drivers.
/tmp (Temporary):
Contains temporary files created by system and users.
Files in this directory are typically deleted upon system reboot.
/usr (User):
Contains user-related programs, libraries, documentation, and source code.
Similar to
/bin
and/lib
, but contains non-essential binaries and libraries.
/var (Variable):
Contains variable data files that are expected to grow or change in size over time.
Log files, spool directories, and temporary files for various services are stored here.