Day 02 β Understanding Linux Architecture, Processes, and systemd
π Introduction
Today I learned what happens inside Linux instead of just running commands blindly.
Linux may seem complicated at first, but when we understand how its parts connect, everything starts making sense.
Linux works in layers, and each layer has a role.
π§© Linux Architecture (How Everything Connects)
Think of Linux like a company structure.
| Layer | Role | Example |
| Hardware | Physical components | CPU, RAM, Disk |
| Kernel | Brain of the system | Manages memory & CPU |
| Shell | Interface between user and kernel | Terminal (bash) |
| Applications | Programs that do work | Nginx, MySQL |
π How They Work Together
When you type a command like:
ls
This happens behind the scenes:
User β Shell β Kernel β Hardware β Result back to user
The shell sends the request, but the kernel actually talks to the hardware.
βοΈ What is a Process?
A process is simply a running program.
Example:
When you start a web server:
systemctl start nginx
Linux creates a process for Nginx.
You can see running processes using:
ps aux
top
Each process has:
PID (Process ID)
CPU usage
Memory usage
State
π Process States (Easy Meaning)
| State | Meaning | Example |
| Running | Using CPU | A script executing |
| Sleeping | Waiting | Nginx waiting for request |
| Stopped | Paused | Process stopped manually |
| Zombie | Finished but not cleaned | Rare system leftover |
Most processes are usually sleeping, not actively running.
π¨βπΌ What is systemd?
When Linux boots, one of the first important programs that starts is systemd.
systemd is the service manager of Linux.
It is responsible for:
Starting services at boot
Stopping services
Restarting services if they crash
Managing service logs
π§ Important systemd Commands
systemctl start nginx # Start a service
systemctl stop nginx # Stop a service
systemctl restart nginx # Restart a service
systemctl status nginx # Check service status
systemctl enable nginx # Start service on boot
systemctl disable nginx # Disable service at boot
journalctl -u nginx # View logs of a service
π§ Real DevOps Example
If a website goes down:
1οΈβ£ Check service status
systemctl status nginx
2οΈβ£ Restart service
systemctl restart nginx
3οΈβ£ Check error logs
journalctl -u nginx
π§ Big Picture (How Everything Works Together)
Letβs say a user opens a website hosted on your server:
1οΈβ£ Nginx process receives the request
2οΈβ£ Process asks kernel for CPU & memory
3οΈβ£ Kernel talks to hardware
4οΈβ£ systemd ensures Nginx keeps running
If Nginx crashes β systemd can restart it automatically.
π 5 Daily Linux Commands
ps aux # Show all processes
top # Live process monitoring
htop # Better system monitor
kill <PID> # Stop a process
systemctl status nginx # Check service health
π― Why This Matters for DevOps
Understanding Linux internals helps you:
β Fix crashed services
β Troubleshoot CPU/memory issues
β Understand logs
β Debug production problems faster
Linux knowledge = Strong DevOps foundation.
See you on Day 03 β Linux File System π