A complete, beginner-friendly guide to learning Linux from scratch. No prior experience needed. Whether you're a student, a future developer, or just someone curious about what's running behind most of the internet — this guide walks you through everything step by step, starting with the absolute basics and building up to real, practical skills.
| # | Chapter | Folder | Status |
|---|---|---|---|
| 1 | What Is Linux and Why Should You Learn It? | Chapter-01-What-Is-Linux |
✅ Published |
| 2 | Navigating the Terminal: Your First Commands | Chapter-02-Navigating-the-Terminal |
✅ Published |
| 3 | Files & Directories: Creating, Moving, and Deleting | Chapter-03-Files-and-Directories |
✅ Published |
| 4 | Users, Permissions & the Root User | Chapter-04-Users-and-Permissions |
✅ Published |
| 5 | Installing & Managing Software with apt | Chapter-05-Installing-and-Managing-Software |
✅ Published |
| 6 | Text Editors: Reading and Editing Files in the Terminal | Chapter-06-Text-Editors |
✅ Published |
| 7 | Processes & System Monitoring | Chapter-07-Processes-and-System-Monitoring |
✅ Published |
| 8 | Networking Basics: Connections, IPs & SSH | Chapter-08-Networking-and-SSH |
✅ Published |
| 9 | Shell Scripting: Automating Tasks with Bash | Chapter-09-Shell-Scripting |
✅ Published |
| 10 | Disk Management & the Filesystem in Depth | Chapter-10-Disk-Management-and-Filesystem |
✅ Published |
| 11 | System Logs, Services & systemd | Chapter-11-System-Logs-Services-and-systemd |
✅ Published |
| 12 | What's Next: Linux in the Real World | Chapter-12-Whats-Next |
✅ Published |
Most Linux tutorials either assume too much knowledge or throw a wall of commands at you without explaining why they matter. This guide takes a different approach. It starts with the big picture — what an operating system actually does, where Linux came from, and why it runs so much of the modern world — before slowly moving into hands-on terminal work.
By the end, you won't just know commands. You'll understand how Linux thinks.
This chapter lays the groundwork for everything else in the guide. It covers:
- The big picture of what an operating system actually does (resource management, hardware abstraction, and the user interface)
- A brief history of Linux — from Unix at Bell Labs in 1969, to Richard Stallman's GNU Project, to Linus Torvalds posting about his "hobby" operating system in 1991
- Linux vs. Windows vs. macOS: an honest, practical comparison across cost, customization, security, and use cases
- What a Linux distribution actually is, and the three major distro families: Debian/Ubuntu, Red Hat/Fedora, and Arch
- Desktop vs. terminal — why both matter and why the terminal holds Linux's real power
- The open-source philosophy behind Linux and why the GPL matters
- Setting up your first Linux environment using WSL2, a virtual machine, dual boot, or a live USB
- Your first login and first command, including a walkthrough of the GNOME desktop and your first terminal session
- A first look at the Linux filesystem, including the single-tree structure rooted at
/and key directories like/home,/etc, and/var
With the background from Chapter 1, this chapter puts your hands on the keyboard. It covers:
- What the shell actually is and the difference between
sh,bash, andzsh - Reading and understanding the shell prompt (
user@host:~$) - Navigating the filesystem with
pwd,ls, andcd - Absolute vs. relative paths — and why the distinction matters
- Useful shortcuts:
~,.,..,-, and tab completion - Getting help directly in the terminal with
man,--help, andwhatis - Your first look at command structure:
command [options] [arguments] - Combining flags and reading manual pages without frustration
✅ Chapter 3 — Files & Directories: Creating, Moving, and Deleting With navigation down, this chapter puts your hands on the filesystem itself. It covers:
- Creating files with
touchand the>/>>redirection operators - Creating directories with
mkdirand nested paths withmkdir -p - Viewing file contents with
cat,less,head, andtail -ffor live logs - Copying files and directories with
cp(and why-iis a good habit) - Moving and renaming with
mv— in one step or both at once - Deleting with
rmandrmdir— and whyrm -rfdeserves extreme caution - Wildcards (
*,?,[]) for acting on multiple files at once - Finding files with
find(live) andlocate(fast index)
With the filesystem covered, this chapter tackles Linux's security model. It covers:
- Users, groups, UIDs, and GIDs — how Linux identifies who you are
- The root user and why you should almost never use it directly
sudo— running privileged commands safely, and how the sudoers file works- The permission model: read, write, execute for owner, group, and others
- Reading and decoding permission strings like
drwxr-xr-x - Changing permissions with
chmodin both symbolic (u+x) and octal (755) mode - Changing ownership with
chownandchgrp - Special permissions: setuid, setgid, and the sticky bit
- Managing users and groups from the command line
With permissions mastered, this chapter covers one of Linux's greatest practical strengths: its software management system. It covers:
- What a package manager is and why it's better than downloading installers
- How
aptworks: repositories, the package index, and Ubuntu's four repo components sudo apt update— refreshing the index (and what it does NOT do)- Installing software with
apt install, including useful flags like-yand--dry-run - Removing software:
removevspurgevsautoremove— and when to use each - Upgrading your entire system with two commands:
update+upgrade - Searching and inspecting packages with
apt search,apt show, anddpkg aptvsapt-get— which to use in the terminal vs in scripts- Adding PPAs and third-party repositories (e.g. Docker, Node.js)
- Installing from source with
configure / make / make install, plus Snap, Flatpak, and AppImage
With software management covered, this chapter tackles a skill you'll use every single day: editing files directly in the terminal. It covers:
- Why terminal text editors matter — especially for remote server work over SSH
- A comparison of available editors: nano, vim, neovim, emacs, and micro
- nano — the beginner-friendly editor: opening files, saving, searching, and the full shortcut reference
- vim — the powerful modal editor: understanding Normal, Insert, Visual, and Command modes
- The golden rule of vim: when in doubt, press
Esc - vim navigation, editing commands, search, and find-and-replace (
:%s/old/new/g) - Working with multiple files and split panes in vim
- Configuring vim with
~/.vimrc— line numbers, syntax highlighting, tab settings - Editing system config files safely: always back up before touching
/etc/fstaborsshd_config - Viewing files without editing:
cat,less,head,tail,grep,wc
With file editing covered, this chapter teaches you to see inside a running Linux system. It covers:
- What a process is: PID, PPID, owner, state, and the full process tree from PID 1
- Viewing processes with
ps aux— reading every column and filtering withgrep - Live monitoring with
topand the improvedhtop - Sending signals to processes:
kill,killall, andpkill— SIGTERM first, SIGKILL last - Job control: running in background with
&, pausing withCtrl+Z, resuming withbgandfg - Keeping processes alive after logout with
nohupand persistent sessions withscreen - Monitoring memory with
free -h, CPU/I/O withvmstatandiostat - Disk usage:
df -hfor filesystem fullness,du -shfor directory sizes - Understanding load average and what it means relative to your CPU core count
With system monitoring covered, this chapter connects your Linux machine to the world. It covers:
- How Linux networking works: interfaces, IP addresses, routes, ports, TCP vs UDP
- Inspecting network interfaces and routing with
ip addr showandip route - Testing connectivity step by step with
ping— loopback → gateway → internet → DNS - Downloading files and interacting with APIs using
curlandwget - Checking open ports and connections with
ss -tlnp - DNS tools:
dig,nslookup, andhost— turning names into IPs - Connecting to remote servers with
SSH— the foundation of remote Linux work - SSH keys: generating ED25519 key pairs, copying public keys, and setting correct permissions
- The
~/.ssh/configfile — shortcuts, port settings, and keepalive configuration - Transferring files securely with
scpand efficiently withrsync - SSH tunnels and local/remote port forwarding
- Firewall management with
ufw— allowing services and protecting your system
With networking covered, this chapter brings everything together — writing scripts that automate repetitive tasks. It covers:
- What a shell script is and when to write one instead of typing commands manually
- The shebang line (
#!/bin/bash), making scripts executable, and running them with./ - Variables, user input with
read, and environment variables like$USER,$HOME,$PWD - Command substitution
$()and arithmetic with$(( )) - Conditionals:
if,elif,else,fi— with real decision-making examples - Three families of test expressions: numeric (
-eq,-gt), string (==,-z), file (-f,-d,-x) - Loops:
forover lists, ranges, and files —whilewith counters and file reading —until - Functions: defining, calling, passing arguments, and returning values
- Script arguments:
$1–$9,$@,$#— and validating them before use - Exit codes,
$?, strict mode withset -euo pipefail, and cleanup withtrap - Three complete real-world scripts: automated backup, system health check, batch file rename
How Linux really represents, partitions, formats, and mounts storage — and how to keep it from silently filling up. It covers:
- How Linux names disks and partitions (
/dev/sda,/dev/nvme0n1p1) and the block device model - Reading disk and partition info with
lsblkandfdisk -l - Creating partitions interactively with
fdisk(and when to reach forpartedinstead) - Formatting partitions with
mkfs.ext4,mkfs.xfs, and other filesystem types - Mounting and unmounting filesystems with
mountandumount, plus common mount options likenoexecandnoatime - Making mounts persistent and reboot-safe with
/etc/fstaband UUIDs - Verifying space and mount status with
df -h,df -i, andfindmnt - Logical Volume Management (LVM) basics:
pvcreate,vgcreate,lvcreate, and online resizing withlvextend - The real difference between symbolic links and hard links, and how
ln -sandlnbehave - What inodes actually store, and why
statandls -imatter when you run out of them with disk space to spare - Hunting down disk hogs with
du -sh, and diagnosingduvsdfdisagreements - Creating and managing swap space with
fallocate,mkswap, andswapon— including building a swap file from scratch - Four practical troubleshooting scenarios: new disk setup, "no space left" with free space showing, fixing OOM kills with swap, and mapping what's mounted where
Every command you've run so far has been reactive — this is where Linux starts working in the background on its own. It covers:
- Why
systemdreplaced sequential SysVinit scripts, and how PID 1 manages a dependency graph of units - Units and targets:
.service,.timer,.mount, and how targets map to the old runlevels - Controlling services with
systemctl start,stop,restart,reload, andstatus - The real difference between
enable/disable(future boots) andstart/stop(right now), plusmask - Reading logs the modern way with
journalctl, including-u,-f,-e, and-r - Filtering
journalctlby--since/--until, priority level (-p), and boot (-b) - The classic
/var/logfiles —syslog,auth.log,kern.log— and how they differ by distro - Keeping logs from growing forever with
logrotateand its per-app config files - Writing a complete
systemd.serviceunit file from scratch, and whydaemon-reloadmatters - Scheduling recurring tasks with
cron,crontab -e, and the five-field time syntax - Cron shortcuts like
@dailyand@reboot, plus system-wide/etc/cron.d/andcron.daily/ - One-time scheduling with
at,atq, andatrm - Catching up on missed jobs with
anacronon machines that aren't always powered on - Four practical scenarios: a service that won't start, a disk filling with logs, setting up a nightly backup, and investigating a boot
The final chapter. You've built the foundation — now here's where it takes you. It covers:
- A complete skill map: every command, concept, and tool covered across all 12 chapters
- Career paths where Linux skills apply directly: sysadmin, DevOps, cybersecurity, cloud, backend, data engineering
- The next layer of tools to learn:
Docker,Kubernetes,Ansible,Terraform, and Python automation - Certifications worth pursuing: CompTIA Linux+, LPIC-1/2, RHCSA, RHCE, and CKA — with what each tests
- How to keep learning:
manpages, the Arch Wiki, official docs, and deliberate practice habits - Building a home lab: VirtualBox VMs, Raspberry Pi, a cloud VPS, or WSL2 — with project ideas
- The Linux community: Ask Ubuntu, Server Fault, Reddit, Arch Wiki, IRC — and how to ask good questions
- Contributing to open source: documentation, bug reports, and your first pull request
- How this guide was built: the design system, ReportLab, and the philosophy behind the writing
- Complete beginners who have never opened a terminal before
- Windows or macOS users curious about Linux
- Students preparing for tech, cybersecurity, or development careers
- Anyone who wants to understand the systems running behind most servers, cloud platforms, and even their own Android phone
Each chapter builds on the one before it, so it's best to go in order — especially in the early chapters. Open a terminal alongside the guide and actually type the commands as you read. Linux is learned by doing, not just by reading.
This guide leans into the terminal early and often, but it doesn't ignore the graphical side of Linux either. You'll get a proper look at desktop environments like GNOME before diving into command-line work, so you understand both faces of the system before choosing which one to lean on.
This guide is complete. If you find a typo, an error, or a command that no longer works on a current Ubuntu release, please open an Issue and describe the problem. If you want to suggest an addition or improvement, open an Issue with your idea before opening a Pull Request. All contributions are welcome.
This project is licensed under the MIT License.
Ashik A — github.com/ashihh07
This guide was created, organized, refined, and designed using GitHub documentation, industry best practices, publicly available learning resources, and AI-assisted research.
If you find this guide helpful, consider starring the repo ⭐ so others can find it too.