Linux Basics Explained — Complete Beginner's Guide
Linux is an open-source operating system kernel that powers everything from phones and laptops to servers and supercomputers. Understanding Linux basics is the foundation for a career in system administration, DevOps, cloud engineering, or cybersecurity.
What You’ll Learn
By the end of this tutorial, you’ll understand what Linux is, how the kernel differs from a full OS, the role of distributions, the file system hierarchy, and how to run your first commands. You’ll also know why Linux dominates the server world.
Why Linux Matters
Linux runs 96% of the world’s top one million web servers, 100% of the top 500 supercomputers, and the majority of cloud infrastructure. Android, which runs on billions of phones, uses the Linux kernel. At DodaTech, DodaZIP and Durga Antivirus Pro both run on Linux servers for stability, security, and performance. Learning Linux gives you the skills to work across virtually any tech environment.
Linux Learning Path
flowchart LR
A[Linux Basics] --> B[Server Setup]
B --> C[Essential Commands]
C --> D[System Administration]
D --> E[Package Management]
A --> F{You Are Here}
style F fill:#f90,color:#fff
What Is Linux?
Think of an operating system like a car. The kernel is the engine — it controls everything but you never see it directly. The distribution is the car model — different brands with different features, but they all use an engine.
Linux (the kernel) was created by Linus Torvalds in 1991. It’s open source, meaning anyone can view, modify, and distribute the source code. This transparency is why Linux is trusted for security-critical systems.
A Linux distribution (distro) packages the kernel with system tools, a desktop environment, and applications. Popular distros include:
- Ubuntu — Beginner-friendly, huge community, great for desktops and servers
- Fedora — Cutting-edge, sponsored by Red Hat, good for developers
- Debian — Rock-solid stable, the foundation for Ubuntu
- CentOS / Rocky Linux — Enterprise-focused, free RHEL alternatives
- Arch Linux — Rolling release, maximum control, steeper learning curve
The File System Hierarchy
Linux organizes everything as files in a single tree starting at /. Here are the most important directories:
| Directory | Purpose |
|---|---|
/ | Root — the top of the file system tree |
/home | User home directories (/home/alice) |
/etc | System configuration files |
/var | Variable data — logs, databases, caches |
/tmp | Temporary files (cleared on reboot) |
/usr | User system resources — binaries, libraries, documentation |
/bin | Essential user command binaries |
/sbin | System administration binaries |
/proc | Virtual file system for process and kernel info |
Your First Linux Commands
Open a terminal and try these:
# Check your current directory
pwdExpected output:
/home/yourusername# List files in the current directory
ls -laExpected output (varies by system):
total 48
drwxr-x--- 12 user user 4096 Jun 7 10:00 .
drwxr-xr-x 3 root root 4096 Jun 1 08:00 ..
-rw------- 1 user user 220 Jun 1 08:00 .bash_logout
-rw-r--r-- 1 user user 3771 Jun 1 08:00 .bashrc
drwxr-xr-x 2 user user 4096 Jun 1 08:00 Desktop
drwxr-xr-x 2 user user 4096 Jun 1 08:00 Documents# Display system information
uname -aExpected output (varies):
Linux hostname 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC x86_64 x86_64 x86_64 GNU/LinuxUnderstanding the Shell
The shell is a program that interprets your commands. The most common shell is Bash (Bourne Again SHell). When you open a terminal, you’re interacting with the shell.
Bash scripting is a critical skill for Linux administration. Every command you run in the terminal can be combined into scripts to automate tasks.
# A simple shell command sequence
echo "Hello from Linux!"
date
whoamiExpected output:
Hello from Linux!
Sun Jun 7 10:15:00 UTC 2026
yourusernameUsers and Permissions
Linux is multi-user by design. Every file has an owner, a group, and permission settings:
# Show file permissions
ls -l /etc/passwdExpected output:
-rw-r--r-- 1 root root 2845 Jun 1 08:00 /etc/passwdBreakdown: -rw-r--r-- means the owner can read/write, the group can read, and everyone else can read. The first character is - for files or d for directories.
Common Linux Mistakes
1. Running Commands as Root Unnecessarily
Using sudo or the root user for everyday work is dangerous. A typo like rm -rf / (space after rf) can destroy your system. Always use a regular user and only escalate privileges when needed.
2. Not Understanding File Permissions
Beginners often chmod 777 everything to make it work. This is a massive security risk. Use the minimum permissions needed: 755 for directories, 644 for files.
3. Ignoring Case Sensitivity
Linux is case-sensitive. File.txt, file.txt, and FILE.TXT are three different files. This is one of the most common sources of “file not found” errors.
4. Using Spaces in File Names
Spaces in file names require escaping or quoting. my file.txt is two arguments to a command. Use underscores or hyphens instead: my-file.txt.
5. Forgetting to Update the System
Running an outdated system means missing security patches. Always update regularly: sudo apt update && sudo apt upgrade on Debian-based systems.
6. Deleting Files Without Checking
rm file.txt is permanent — there’s no trash can in the terminal. Use rm -i to get prompted before each deletion.
7. Not Using Tab Completion
Typing full paths is error-prone. Press Tab to auto-complete file names, commands, and paths. It saves time and prevents typos.
Practice Questions
1. What is the difference between the Linux kernel and a Linux distribution?
The kernel is the core of the operating system that manages hardware and system resources. A distribution packages the kernel with system tools, applications, and a package manager to create a complete, usable operating system.
2. What does the command ls -la do?
It lists all files in the current directory, including hidden files (those starting with a dot), in long format showing permissions, owner, size, and modification date.
3. What do the permissions -rwxr-xr-- mean?
The owner can read, write, and execute. The group can read and execute. Others can only read. The leading - indicates it’s a regular file (not a directory).
4. Why is running as root dangerous?
Root has unlimited power. A single mistyped command can delete critical system files, open security holes, or make the system unusable. Always use a regular user and sudo for specific tasks.
5. Challenge: In your home directory, create a file named hello.txt, write “Hello Linux” into it, then display its contents. Do it without using a text editor.
Answer: echo "Hello Linux" > hello.txt && cat hello.txt
Mini Project: System Information Script
Create a script that displays key system information:
#!/bin/bash
# system_info.sh — Display basic system information
echo "=== System Information ==="
echo "Hostname: $(hostname)"
echo "Kernel: $(uname -r)"
echo "Architecture: $(uname -m)"
echo "CPU Cores: $(nproc)"
echo "Memory: $(free -h | grep Mem | awk '{print $2}')"
echo "Disk: $(df -h / | tail -1 | awk '{print $2}')"
echo "Uptime: $(uptime -p)"
echo "Current Users: $(who | wc -l)"
echo "=========================="Save as system_info.sh, make it executable with chmod +x system_info.sh, then run ./system_info.sh.
Expected output (varies):
=== System Information ===
Hostname: my-server
Kernel: 6.8.0-31-generic
Architecture: x86_64
CPU Cores: 4
Memory: 15Gi
Disk: 234G
Uptime: up 3 days, 2 hours
Current Users: 2
==========================This script pulls from the same commands system administrators use daily to monitor production servers. In fact, similar monitoring scripts run behind DodaZIP and Durga Antivirus Pro to track server health and trigger alerts when resources are low.
FAQ
What’s Next
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro