Linux Architecture
DevOps engineer sharing daily learnings on Linux, Docker, Kubernetes, CI/CD, and Cloud.
If you are new to Linux, you might wonder:
π How does Linux actually work inside?
π What happens when I type a command in the terminal?
Linux architecture answers these questions. It explains how Linux is structured and how different parts work together to run your system.
Donβt worryβno complex terms.
What is linux architecture ?
Linux architecture is the internal structure of the Linux operating system.
It shows how:
Users interact with Linux
Commands are processed
Hardware like CPU, memory, and disk are used
High-Level Linux Architecture
Linux follows a layered design, meaning each layer has a specific role.
User
β
Applications & Shell
β
System Calls
β
Linux Kernel
β
Hardware
Weβll understand each layer one by one.
User Space (Applications)
User space contains:
Commands like
ls,cp,grepApplications like browsers
DevOps tools (Docker, kubectl)
These programs:
Run with limited permissions
Cannot directly access hardware
Depend on the kernel
Shell (Command Line Interface)
The shell is where users type commands.
Popular shells:
bash
sh
zsh
Example:
ls
System Call Interface
Applications cannot talk to the kernel directly.
They use system calls to request services.
Example system calls:
read()write()open()
π Simple explanation:
System calls are like a request form submitted to the kernel.
Example command:
strace ls
Linux Kernel (The Heart of Linux)
The kernel is the most important part of Linux. It acts as a bridge between hardware and users.
What does the kernel do ?
πΉ Process Management
Starts programs
Stops programs
Decides which program uses the CPU
πΉ Memory Management
Allocates RAM to programs
Frees memory when programs stop
Manages swap space
πΉ File System Management
Handles files and folders
Controls file permissions
Manages disks
Linux file systems: ext4 , xfs , nfs
πΉ Device Management
Controls hardware devices
Uses device drivers
πΉ Network Management
Handles internet and networking
Manages IP addresses, ports, firewalls
Hardware Layer
This is the physical part of the system, such as:
CPU
RAM
Hard Disk / SSD
Network card
Keyboard, mouse
Linux does not allow users or applications to directly control hardware.
This keeps the system safe and stable.
π Real Example: Running the ls Command
Imagine you type this in the terminal:
ls
Now letβs see how Linux architecture works step by step.
Step 1: User (You)
You are the user sitting at the computer and typing a command.
π You want to see the list of files in a directory.
Step 2: Shell
The shell (for example, bash) receives your command.
It checks if
lsis a valid commandIt prepares the request for the system
The shell cannot access files directly.
Step 3: System Calls
To read directory contents, the shell asks the kernel for help using system calls like:
open()read()
Think of system calls as a legal way for programs to request services from the kernel.
Step 4: Linux Kernel
The kernel does the real work:
Checks if you have permission to read the directory
Communicates with the file system
Reads data from the disk
The kernel is the only part allowed to talk to hardware.
Step 5: Hardware
The disk (SSD/HDD):
- Sends file data to the kernel
The kernel then sends this data back to the shell.
Step 6: Output to User
The shell displays the result on your screen:
file1.txt
file2.log
docs/
This Explains Linux Architecture
User β Shell β System Call β Kernel β Hardware
β
Response
User gives instruction
Shell interprets it
Kernel manages resources
Hardware performs the action