How Linux Works ? The Journey of a Simple ls Command

Опубликовано: 05 Июнь 2026
на канале: Gate & Kernel
457
9

A simple ls command traveled through the entire Linux stack. The shell interpreted the command. The kernel loaded the program. The scheduler assigned CPU time. The CPU executed instructions.

A system call entered the kernel.The Virtual File System processed the request. Directory entries were retrieved. The data returned to User Space. The output was formatted and displayed.

All of this happened in just a few milliseconds.This journey demonstrates how Linux really works. Applications talk to the kernel. The kernel talks to the hardware.

And Linux coordinates everything in between. That is how Linux works.

Step 1 — User Types Command
Step 2 — Shell Receives Input
Step 3 — Shell Finds Program
Step 4 — Create Child Process
Step 5 — Load ls Program
Step 6 — Load Executable Into Memory
Step 7 — Scheduler Assigns CPU
Step 8 — CPU Begins Executing ls
Step 9 — ls Needs Directory Data
Step 10 — Request Directory Information
Step 11 — Kernel Takes Control
Step 12 — System Call Handler
Step 13 — VFS Receives Request
Step 14 — Locate Directory
Step 15 — Check Page Cache
Step 16 — Cache Hit or Cache Miss
Step 17 — Read Directory Entries
Step 18 — Return Data To Kernel
Step 19 — Copy To User Space
Step 20 — ls Receives Data
Step 21 — Format Output
Step 22 — Write To Terminal
Step 23 — Terminal Displays Result
Conclusion