đ§ Linux Fundamentals¶
Understanding the foundations of Linux, the operating system at the heart of Born2beroot.
Table of Contents¶
- What is Linux?
- The Linux Philosophy
- What is the Kernel?
- User Space vs Kernel Space
- Linux Distributions
- Debian
- Rocky Linux
- Why So Many Distributions?
- The Linux Boot Process
- BIOS and UEFI
- Bootloaders
- systemd
- The Shell
- Common Shells
- Terminal vs Shell
- Commands and Utilities
- Processes
- Process Lifecycle
- Foreground vs Background Processes
- Process IDs (PID)
- Files and Directories
- Linux Filesystem Hierarchy
- Important Directories
- Paths
- Hidden Files
- Environment Variables
- Package Managers
- Why Linux Dominates Servers
- Mental Model
1ī¸âŖ What is Linux?¶
Linux is an operating system.
An operating system sits between:
Hardware
â
Operating System
â
Applications
Without an operating system, applications would need to communicate directly with hardware.
Linux provides a stable and secure layer that allows software to run efficiently.
2ī¸âŖ The Linux Philosophy¶
Linux follows a simple philosophy:
Do one thing and do it well
Many Linux tools are intentionally small and focused.
Examples:
- grep
- cat
- find
- sort
- chmod
Each solves a specific problem.
3ī¸âŖ What is the Kernel?¶
The kernel is the core of Linux.
Think of it as the operating system's manager.
Responsibilities include:
- CPU scheduling
- memory management
- hardware communication
- process management
- filesystem access
4ī¸âŖ User Space vs Kernel Space¶
Linux separates the system into two worlds.
User Space¶
Applications run here.
Examples:
- Firefox
- VSCode
- Python
Kernel Space¶
The kernel runs here.
Applications must ask permission before accessing hardware.
This separation improves security and stability.
5ī¸âŖ Linux Distributions¶
Linux itself is only the kernel.
A distribution combines:
- Linux kernel
- package manager
- utilities
- configuration tools
- documentation
Examples:
- Debian
- Ubuntu
- Rocky Linux
- Fedora
- Arch Linux
6ī¸âŖ Debian¶
Debian is one of the oldest and most respected Linux distributions.
Known for:
- stability
- reliability
- large repositories
- conservative updates
Many other distributions are based on Debian.
7ī¸âŖ Rocky Linux¶
Rocky Linux focuses on enterprise environments.
Known for:
- Red Hat compatibility
- long-term support
- server usage
It is commonly found in professional infrastructures.
8ī¸âŖ Why So Many Distributions?¶
Different users have different goals.
Some prioritize:
- stability
- performance
- security
- ease of use
- customization
This is why many Linux distributions exist.
9ī¸âŖ The Linux Boot Process¶
A simplified boot sequence:
Power On
â
BIOS / UEFI
â
Bootloader
â
Kernel
â
systemd
â
Services
â
Login
Understanding this sequence helps explain how Linux starts.
đ BIOS and UEFI¶
These systems initialize hardware before Linux starts.
Responsibilities:
- detect hardware
- perform checks
- locate boot devices
UEFI is the modern replacement for BIOS.
1ī¸âŖ1ī¸âŖ Bootloaders¶
A bootloader loads the operating system.
One common example is:
GRUB
Its job is to locate and start the Linux kernel.
1ī¸âŖ2ī¸âŖ systemd¶
systemd is responsible for managing the system after the kernel starts.
It handles:
- service startup
- dependencies
- logging
- process supervision
Modern Linux distributions rely heavily on systemd.
1ī¸âŖ3ī¸âŖ The Shell¶
The shell is the interface between the user and the operating system.
You type commands:
ls
pwd
cd
The shell interprets them and communicates with the system.
1ī¸âŖ4ī¸âŖ Common Shells¶
Examples include:
- Bash
- Zsh
- Fish
- Dash
Bash remains the most widely known shell.
1ī¸âŖ5ī¸âŖ Terminal vs Shell¶
These terms are often confused.
Terminal¶
The application window.
Shell¶
The program running inside that window.
Example:
Terminal
â
Bash
1ī¸âŖ6ī¸âŖ Commands and Utilities¶
Linux provides many small tools.
Examples:
ls
pwd
cat
grep
find
Combining small tools is one of Linux's greatest strengths.
1ī¸âŖ7ī¸âŖ Processes¶
A process is a running program.
Examples:
Python Script
Browser
SSH Server
Every running application becomes a process.
1ī¸âŖ8ī¸âŖ Process Lifecycle¶
A process typically follows:
Created
â
Running
â
Waiting
â
Finished
The kernel manages this lifecycle.
1ī¸âŖ9ī¸âŖ Foreground vs Background Processes¶
Foreground¶
Runs directly in the terminal.
Background¶
Runs independently.
Examples include:
- servers
- monitoring services
- daemons
2ī¸âŖ0ī¸âŖ Process IDs (PID)¶
Every process receives a unique identifier.
Example:
PID 100
PID 250
PID 421
The kernel uses these IDs to manage processes.
2ī¸âŖ1ī¸âŖ Files and Directories¶
Linux treats almost everything as a file.
Examples:
- documents
- devices
- logs
- configuration files
This creates a consistent environment.
2ī¸âŖ2ī¸âŖ Linux Filesystem Hierarchy¶
Linux follows a standard structure.
/
âââ home
âââ etc
âââ usr
âââ var
âââ boot
âââ tmp
Everything starts from the root directory.
2ī¸âŖ3ī¸âŖ Important Directories¶
/home¶
User files.
/etc¶
Configuration files.
/var¶
Logs and changing data.
/boot¶
Boot-related files.
/tmp¶
Temporary files.
2ī¸âŖ4ī¸âŖ Paths¶
Linux uses paths to locate files.
Example:
/home/student/document.txt
Paths can be:
- absolute
- relative
2ī¸âŖ5ī¸âŖ Hidden Files¶
Files beginning with:
.
are hidden by default.
Examples:
.bashrc
.profile
.gitignore
2ī¸âŖ6ī¸âŖ Environment Variables¶
Environment variables store configuration values.
Examples:
PATH
HOME
USER
SHELL
Applications often rely on them.
2ī¸âŖ7ī¸âŖ Package Managers¶
Package managers simplify software installation.
Examples:
- apt
- dnf
- yum
They manage:
- installation
- updates
- dependencies
2ī¸âŖ8ī¸âŖ Why Linux Dominates Servers¶
Linux powers most servers because it offers:
â Stability
â Performance
â Security
â Flexibility
â Open-source development
Many cloud platforms rely heavily on Linux.
2ī¸âŖ9ī¸âŖ Mental Model¶
Think of Linux as:
The operating system city
The kernel is:
The city manager
Processes are:
The citizens
The filesystem is:
The map
And the shell is:
Your way of communicating with the city