Linux File System Basics
Understanding Linux Filesystem Architecture
Linux filesystem is a hierarchical structure that organizes data storage and file management. The root directory /
serves as the primary entry point for the entire system, containing critical system directories and files.
Key Directory Structure
graph TD
A[/] --> B[/bin]
A --> C[/etc]
A --> D[/home]
A --> E[/var]
A --> F[/usr]
Directory |
Purpose |
/bin |
Essential user command binaries |
/etc |
System configuration files |
/home |
User home directories |
/var |
Variable data files |
/usr |
User utilities and applications |
File Types in Linux
Linux supports multiple file types, each represented by a unique character:
- Regular files:
-
- Directories:
d
- Symbolic links:
l
- Block devices:
b
- Character devices:
c
Filesystem Exploration Commands
## List filesystem structure
ls -l /
## Display file types and permissions
stat /etc/passwd
## Check filesystem disk usage
df -h
Permissions and Access Control
Linux uses a robust permission system with read (r), write (w), and execute (x) permissions for user, group, and others.
## Change file permissions
chmod 755 myfile
## Change file ownership
chown user:group myfile
The filesystem provides a secure and organized method for managing system resources, enabling efficient data storage and retrieval in Linux environments.