Linux File System Overview
Understanding Linux Filesystem Structure
Linux filesystem is a hierarchical tree-like structure that organizes data and provides systematic access to files and directories. The root directory (/) serves as the primary entry point for the entire filesystem hierarchy.
graph TD
A[Root Directory /] --> B[bin]
A --> C[etc]
A --> D[home]
A --> E[var]
A --> F[usr]
Key Linux Directory Types
Directory |
Purpose |
Typical Contents |
/bin |
Essential user binaries |
System commands |
/etc |
System configuration |
Config files |
/home |
User home directories |
Personal files |
/var |
Variable data |
Logs, temporary files |
/usr |
User programs |
Applications, libraries |
Filesystem Hierarchy Standard (FHS)
The Linux filesystem follows a standardized structure that ensures consistency across different distributions. Each directory has a specific purpose and maintains a logical organization.
Filesystem Exploration Commands
## List root directory contents
ls /
## Show filesystem disk space usage
df -h
## Display directory structure
tree /
The ls
command reveals the root directory's structure, while df -h
provides disk usage information. The tree
command offers a comprehensive view of the filesystem hierarchy.
Filesystem Mounting Mechanism
Linux supports multiple filesystem types and allows dynamic mounting of different storage devices. The /etc/fstab
file manages permanent mount points and filesystem configurations.
## View current mount points
mount
## Mount a filesystem
mount /dev/sda1 /mnt/external
These commands demonstrate how filesystems are accessed and mounted in a Linux environment, providing flexible storage management.