Linux: Introduction to Linux — The Open-Source OS Revolution
Linux is the operating system every developer will eventually face. Whether you're deploying backend services, configuring databases, or running CI/CD pipelines, the server is most likely running Linux.
📋 Prerequisites: No prior experience required
1. What You Will Learn
- The fundamental differences between Linux, Windows, and macOS
- The open-source philosophy and the GNU/Linux relationship
- Strategies for choosing a Linux distribution
- Why Linux dominates the server market
- The current state of Linux on the desktop
2. A Beginner's Story: First Encounter with a Server
(1) The Pain: Feeling Lost When Facing a Server for the First Time
Alex is a developer who recently switched to Linux. His company gave him a MacBook, but his backend colleagues fly through the terminal. He needed to log into a Linux server to check logs, yet after opening the terminal he didn't even know what "ls" meant.
Senior engineer Bob told him: "Linux is an essential skill for every developer — not because you need it as a desktop OS, but because the vast majority of internet services run on Linux."
(2) Linux's Solution
Bob introduced Alex to Linux: a free, open-source operating system kernel stable enough to run continuously for years. Any device — from a Raspberry Pi to a NASA Mars rover — can run it.
# Check how long a Linux server has been running
uptime
# Sample output: 10:23 up 187 days, 4 users, load average: 0.08 0.03 0.01
(3) The Benefit: Understanding Infrastructure
After completing this lesson, Alex understood what OS powers the GitHub, Netflix, and YouTube services he uses every day — and why Linux dominates the server market.
3. Knowledge Points
(1) What Is Linux
Strictly speaking, Linux is only a kernel — the core component of an operating system responsible for managing hardware resources, process scheduling, filesystems, and more. In 1991, Finnish university student Linus Torvalds released its first version.
But what people commonly call "Linux" actually refers to the GNU/Linux operating system — the complete combination of the Linux kernel and the GNU toolset (commands like cp, mv, ls, bash, etc.).
(2) Linux vs Windows vs macOS
The three major operating systems differ fundamentally in design and philosophy:
| Dimension | Linux | Windows | macOS |
|---|---|---|---|
| Kernel | Linux (open source) | NT (closed source) | XNU (partially open) |
| Package management | apt/yum/dnf | EXE/MSI | Homebrew |
| Command line | bash/zsh (core experience) | PowerShell (add-on) | zsh (Linux-like) |
| Filesystem | ext4/XFS/Btrfs | NTFS | APFS |
| Desktop environment | GNOME/KDE (user's choice) | Fixed desktop | Aqua |
| License | GPL (open source, free) | Commercial license | Commercial license |
| Primary market | Servers / Embedded | Desktop / Enterprise | Desktop / Creative |
(3) Major Distribution Families
Linux has hundreds of distributions, but only four core families:
| Family | Package manager | Representative distros | Best for |
|---|---|---|---|
| Debian family | apt/.deb | Ubuntu, Debian, Linux Mint | Beginners, servers |
| RHEL family | yum/dnf/.rpm | RHEL, Fedora, CentOS | Enterprise servers |
| Arch family | pacman | Arch Linux, Manjaro | Enthusiasts, latest software |
| Alpine | apk | Alpine Linux | Minimal Docker images |
(4) Why Servers Run Linux
- Free: No Windows Server licensing fees
- Stable: A server can run for years without rebooting
- Remote-friendly: Manage via SSH terminal, no GUI needed
- Low resource usage: A command-line interface only needs a few hundred MB of RAM
- Rich ecosystem: Nginx/MySQL/Python/Node.js all prioritize Linux support
- Container-native: Docker/Kubernetes run natively on Linux
(5) ▶ Example: Check the Linux Kernel Version
uname -r
# Sample output: 5.15.0-91-generic
Output:
TEXT5.15.0-91-generic
(6) ▶ Example: Check Distribution Information
lsb_release -a
# Sample output:
# Distributor ID: Ubuntu
# Description: Ubuntu 22.04.3 LTS
# Release: 22.04
# Codename: jammy
(7) ▶ Example: Check System Uptime
uptime
# Sample output: 10:23:45 up 187 days, 4 users, load average: 0.08 0.03 0.01
Output:
TEXT10:23:45 up 187 days, 4 users, load average: 0.08, 0.03, 0.01
(8) ▶ Example: Check CPU and Memory Information
# CPU info
lscpu | grep "Model name"
# Total memory
free -h | grep Mem
Output:
TEXTModel name: Intel(R) Core(TM) i7-12700K Mem: 15Gi 4.0Gi 11Gi 256Mi 2.0Gi 11Gi
(9) ▶ Example: Package Management Commands Across Distributions
# Debian/Ubuntu
sudo apt install nginx
# RHEL/Fedora/CentOS
sudo yum install nginx # or dnf
sudo dnf install nginx
# Arch
sudo pacman -S nginx
# Alpine
apk add nginx
Output:
TEXTReading package lists... Done Building dependency tree... Done The following NEW packages will be installed: nginx 0 upgraded, 1 newly installed, 0 to remove. Need to get 42.3 kB of archives.
(10) ▶ Comprehensive Example: Get to Know Your Linux System
Log into a Linux machine (or WSL) and run the following commands to learn its basic information:
echo "=== Kernel Version ===" && uname -r && \
echo "=== Distribution ===" && lsb_release -d && \
echo "=== Uptime ===" && uptime && \
echo "=== CPU ===" && lscpu | grep "Model name" && \
echo "=== Memory ===" && free -h | grep Mem
❓ FAQ
Q: What's the difference between Linux and Unix? A: Unix is an OS developed at Bell Labs in the 1970s, commercially licensed and closed source. Linux is a Unix-like kernel written from scratch by Linus Torvalds, fully open source and free, containing no Unix code. Linux is described as "Unix-like."
Q: Why do most servers run Linux? A: Free (no Windows Server license fees), stable (can run for years without rebooting), low resource usage (CLI only needs a few hundred MB of RAM), remote-friendly (SSH), and rich ecosystem (nearly all server software prioritizes Linux support).
Q: Which distribution is best for beginners? A: \1
Q: Is Linux on the desktop suitable for daily use? A: Suitable for general office work (browser/office apps/dev tools), but still has shortcomings: the Adobe suite is unavailable, some games aren't supported, and the Tencent ecosystem (WeChat/QQ) has a mediocre experience. For developers, we recommend Windows/Mac for the desktop + WSL/virtual machine for development.
Q: What's the relationship between the Linux kernel and GNU/Linux? A: \1
📖 Summary
- Linux is an open-source kernel created by Linus Torvalds in 1991
- The complete OS is called GNU/Linux (Linux kernel + GNU toolset)
- Four major distribution families: Debian / RHEL / Arch / Alpine
- Linux dominates the server market because it's free, stable, remote-friendly, and container-native
- Ubuntu LTS is recommended for beginners
📝 Exercises
- Basic (Difficulty ⭐): Search for "Linux market share 2025" and learn the differences in market share across server, desktop, and embedded markets
- Intermediate (Difficulty ⭐⭐): Compare Ubuntu and Fedora on their official websites (desktop vs server, stability vs new features) and organize the results in a table
- Advanced (Difficulty ⭐⭐⭐): List 5 websites/apps you use daily, find out whether they run on Linux (hint: check WhoIsHostingThis), and summarize Linux's role in internet infrastructure