The
Kernel
& The Shell
Linux is the backbone of the internet, cloud computing, and supercomputers. It is a Unix-like operating system that gives users direct control over hardware through powerful command-line tools.
A Hobby that Changed the World
Before Linux, there was Unix. Developed in 1969 at AT&T Bell Labs by Ken Thompson, Dennis Ritchie, and others, Unix was a revolutionary operating system designed for multi-user multitasking. It introduced key software design philosophies like "everything is a file" and modular pipeline utilities. Because Unix became commercialized, proprietary, and highly expensive, it motivated developers to build open-source alternatives.
In 1991, a Finnish student named Linus Torvalds announced a "hobby" project: a free operating system kernel. He wanted a Unix-like system similar to Minix (an educational microkernel Unix) but for his 386 personal computer.
"I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones..."
This project combined with the GNU Project (started by Richard Stallman to create free software tools) to form the complete GNU/Linux operating system. Today, Linux runs everything from the world's top 500 supercomputers to the Android phone in your pocket.
MINIX: The Microkernel Inspiration
MINIX (Mini-Unix) is a Unix-like computer operating system based on a microkernel architecture, created by Professor Andrew Tanenbaum in 1987 for educational purposes. Unlike Linux's monolithic kernel design, MINIX keeps the kernel minimal, running drivers and filesystems as separate, isolated user-space processes.
Linus Torvalds used MINIX to learn operating system development but created Linux because MINIX originally had licensing restrictions and lacked support for key hardware features of his new Intel 386 computer. This famously led to the Tanenbaum-Torvalds debate on Usenet in 1992, arguing the merits of microkernels vs. monolithic kernels.
Understanding the Beast
Before typing commands, it helps to know what you are actually talking to. Linux isn't just one program; it's a layered system.
Layers of Abstraction
Hover over the diagram to explore the system layers.
- User: You & your applications.
- Shell: The command interpreter.
- Kernel: Core OS & Resource Management.
- Hardware: The physical machine.
The Filesystem Hierarchy
Unlike Windows (C:\, D:\), Linux has a single tree starting at root
/.
Linux OS Families (Distributions)
Linux is just a kernel. To make it a usable operating system, developers bundle it with system utilities, package managers, and software. These packages are called Distributions (or "Distros"). Different distros target different use cases.
Debian
Known as the "universal operating system," Debian is a massive community-led project prioritizing absolute stability and free software philosophy.
- Package Manager:
apt/dpkg(.deb) - Primary Use: Rock-solid web servers, infrastructure foundations, upstream base for Ubuntu.
- Core Strength: High security, exceptional reliability, and huge package repository.
Ubuntu
Built on top of Debian's testing branch. Focuses on polished user experience, developer ease, and commercial backing (Canonical).
- Package Manager:
apt/snap - Primary Use: Personal laptops, cloud servers, machine learning workstations, CI/CD pipelines.
- Core Strength: Extensive community help, easy driver installation, and widespread cloud support.
Kali Linux
A specialized distribution derived from Debian, tailored specifically for security professionals and ethical hackers.
- Package Manager:
apt/dpkg - Primary Use: Penetration testing, security auditing, digital forensics, reverse engineering.
- Core Strength: Pre-installed with hundreds of specialized tools (Nmap, Wireshark, Metasploit).
RHEL / Fedora
Built for enterprise environments requiring strict security, compliance, and support.
- Package Manager:
dnf/rpm - Primary Use: Enterprise server infrastructure, corporate workstations.
- Core Strength: Commercial support, SELinux security integration, long-term stability.
Arch Linux
Designed for power users who want complete control over their operating system configuration.
- Package Manager:
pacman(with AUR support) - Primary Use: Developer workstations, gaming rigs, custom setups.
- Core Strength: Rolling release model (always up-to-date), extreme DIY customizability.
Alpine Linux
An ultra-lightweight, security-oriented distribution designed for modern cloud container workloads.
- Package Manager:
apk - Primary Use: Docker containers, microservices, embedded systems.
- Core Strength: Tiny footprint (~5MB base size), fast startup, and reduced attack surface.
Filesystem Navigation
Moving through the directory tree. In Linux, everything starts from root (/).
Essential commands for orienting yourself in the hierarchy.
/home/user/projects
# List files - What is here? # -l: long format, -a: all files (hidden), -h: human readable sizes $ls -lah
# Change Directory - Go somewhere else $cd /var/log // Go to absolute path $cd .. // Go up one level $cd ~ // Go to home directory
File Operations
Creating, moving, copying, and destroying files.
# Make a directory (and parents if needed) $mkdir -p project/src/assets
# Copy files # -r: recursive (for directories) $cp -r source_folder backup_folder
# Move or Rename files $mv oldname.txt newname.txt
# Remove files (Careful!) # -rf: recursive and force (No confirmation) $rm -rf junk_folder
Content & Search
Reading files and finding them.
# Head & Tail - First/Last 10 lines $head -n 5 large_log.txt $tail -f server.log // Follow live updates
# Find files by name $find . -name "*.js"
# Grep - Search text INSIDE files # -r: recursive, -i: case insensitive $grep -r "TODO" src/
Archiving & Compression
# Extract Tarball # x: extract $tar -xvzf backup.tar.gz
# Zip / Unzip $zip -r static.zip static/ $unzip static.zip
Permissions & Ownership
Linux is multi-user. Every file has read (r), write (w), and execute (x) permissions for User, Group, and Others.
# Add execute permission for everyone $chmod +x run.sh
# Change Owner # user:group $chown human:undrstanding file.txt
System Information
# Disk Usage (Free space) # -h: human readable (GB/MB) $df -h
# Directory Space Usage $du -sh node_modules/
# Memory (RAM) Usage $free -h
# System Uptime $uptime
Process Management
# Snapshot of current processes $ps aux | grep node
# Kill a process by PID $kill 1234
# Force kill $kill -9 1234
Networking
# IP Address Configuration (Modern way) $ip addr show
# Network Statistics (Ports listening) # -t: tcp, -u: udp, -l: listening, -p: program name $netstat -tulpn # or 'ss -tulpn'
# Secure Shell (SSH) $ssh -i key.pem user@server.com
# File Transfer over SSH (SCP) $scp file.txt user@server.com:/var/www
# HTTP Requests $curl -I https://google.com $wget https://example.com/file.zip
Input/Output Redirection
The Unix Philosophy
Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.
# Output Redirection (Append) $echo "Another line" >> hello.txt
# The Pipe (|) - Connect output of one to input of next # Count lines in files containing "error" $grep "error" server.log | wc -l
Pipeline Visualization
Green = Info (Ignored), Red = Error (Passed through grep)
Key Definitions
Linux
A free, open-source operating system kernel created by Linus Torvalds.
Kernel
The core component of an OS that manages hardware and system resources.
Shell
A program that takes commands from the keyboard and gives them to the OS to perform.
Root (/)
The top-level directory of the Linux filesystem hierarchy.
Sudo
"SuperUser DO". A command that allows a permitted user to execute a command as the superuser.
Permissions
Rights given to users and groups to read, write, or execute files.
Process
An instance of a running program.
SSH (Secure Shell)
A protocol for operating network services securely over an unsecured network.
Pipe (|)
A mechanism for inter-process communication, taking the output of one process and using it as input for another.
Daemon
A background process that answers requests for services.