Linux Fundamentals: Complete Beginner's Guide with Simple Explanations
Everything you need to know about Linux :
📅 Published: Feb 2026
⏱️ Estimated Reading Time: 12 minutes
🏷️ Tags: Linux Basics, Command Line, Beginners Guide, File System, DevOps Foundation
🐧 What is Linux? History & Distributions
What is Linux?
Imagine Linux as the operating system (like Windows or macOS) that runs on most servers worldwide. But there's a key difference: Linux is open-source, which means anyone can see how it works, modify it, and share it for free. It was created by Linus Torvalds in 1991 as a hobby project that grew into something huge!
Why does this matter for you? Because when you work in DevOps or system administration, you'll be managing Linux servers. Almost all websites, mobile apps (Android runs on Linux), cloud services, and supercomputers use Linux behind the scenes.
What are Linux Distributions?
Think of Linux as a car engine. Different companies put that engine in different car bodies with different features:
Ubuntu = Family sedan (easy to use, great for beginners)
CentOS/RHEL = Business fleet car (stable, reliable for companies)
Alpine = Motorcycle (lightweight, perfect for containers)
# To check which Linux you're using: cat /etc/os-release
This command shows your Linux version, just like checking your car's model.
Understanding Kernel, Shell & Filesystem
The Kernel: Linux's Brain
The kernel is the core program that controls everything. It manages:
CPU (processor time)
Memory (RAM usage)
Devices (disks, keyboards, networks)
Security (who can do what)
Analogy: If Linux were a restaurant, the kernel would be the head chef who manages all kitchen operations but never talks to customers.
The Shell: Your Interface
The shell is how you talk to Linux. When you type commands, the shell translates them for the kernel. The most common shell is Bash (Bourne Again Shell).
Analogy: The shell is like a waiter who takes your order (command) and tells the chef (kernel) what to cook.
The Filesystem: Everything is a File
In Linux, everything is a file:
Documents = files
Folders = files
Hardware devices = files
Network connections = files
This makes everything consistent. You use the same commands to work with documents, printers, or network cards.
# See your kernel version (the "brain" version) uname -r # Check your shell (your "translator") echo $SHELL
🏗️ Linux Architecture: User Space vs Kernel Space
Simple Explanation:
Imagine a secure office building:
Kernel Space = Secure vault room (only authorized personnel)
User Space = Regular office area (where everyone works)
What happens when you run a command:
You type
lsin user spaceShell sends request to kernel space
Kernel accesses the hard disk securely
Results come back to user space
You see the file list
Why this separation? Security! If a program crashes in user space, it won't crash the whole system. The kernel stays protected.
# See what's running in user space (regular programs) ps aux # Kernel manages these, but you see results in user space
⌨️ Basic Linux Commands Explained
Navigation Commands:
pwd # "Print Working Directory" - Shows where you are # Like looking at your GPS location ls # "List" - Shows files in current folder # Like opening a drawer to see what's inside cd # "Change Directory" - Move to different folder # Like walking from living room to kitchen
File Operations:
# Creating mkdir folder_name # Make new folder (directory) touch file.txt # Create empty file # Viewing cat file.txt # Show entire file contents less file.txt # View file page by page (press 'q' to exit) # Copying & Moving cp file1.txt file2.txt # Copy file (make duplicate) mv old.txt new.txt # Rename or move file # Deleting rm file.txt # Remove file permanently # WARNING: No recycle bin in Linux!
Why These Commands Matter:
As a DevOps engineer, you'll use these commands daily to:
Navigate server folders
Check configuration files
Create scripts
Manage application files
💻 Working with Command Line (CLI vs GUI)
Why DevOps Prefers Command Line:
GUI (Graphical User Interface) = Clicking buttons with mouse
CLI (Command Line Interface) = Typing commands
Example Task: Install software and check its status
GUI way:
Open software center
Search for program
Click install
Open another window to check status
Click through menus
CLI way:
sudo apt install nginx systemctl status nginx
Done in 2 commands!
CLI Advantages:
Faster: Type vs click
Repeatable: Same commands work every time
Automate: Can write scripts
Remote: Work on servers anywhere via SSH
Documentation: Commands can be saved and shared
Essential CLI Tips:
# Tab completion - Saves typing # Type: cd /usr/loc [Press Tab] # Auto-completes to: cd /usr/local/ # Command history history # See all past commands !! # Run last command again # Get help man command_name # Full manual command_name --help # Quick help
🔐 File Permissions and Ownership
Why Permissions Matter:
Linux is multi-user - many people can use the same server. Permissions control:
Who can read files
Who can modify files
Who can run programs
Understanding Permission Notation:
-rwxr-xr-- 1 user group 1024 Feb 10 file.txt │└─┬──┴─┬──┘ │ │ └── Others: read only (r--) │ └─── Group: read and execute (r-x) └────── Owner: read, write, execute (rwx)
Three types of people:
Owner (u): File creator
Group (g): Group of users
Others (o): Everyone else
Three types of permissions:
r = read (view file)
w = write (edit/delete)
x = execute (run as program)
Changing Permissions:
# Numeric way (easier): # r=4, w=2, x=1 chmod 755 script.sh # Owner: rwx(7), Group: r-x(5), Others: r-x(5) # Letter way (more readable): chmod u+x script.sh # Add execute for owner chmod o-w file.txt # Remove write for others # Changing ownership: chown username:groupname file.txt
Real Examples:
# Web server files (readable by all) chmod 644 index.html # Owner: read/write, Others: read only # Script file (executable) chmod 755 backup.sh # Everyone can read/run, only owner can edit # Secret configuration (private) chmod 600 config.yaml # Only owner can read/write
📁 File Types and Links
Different File Types:
Linux has 7 file types. Most common:
- = Regular file (documents, images)
d = Directory (folder)
l = Symbolic link (shortcut)
# Check file type file document.pdf # Shows "PDF document" file /dev/sda # Shows "block device"
Hard Links vs Soft Links:
Hard Link = Clone of original file
Both files share same content
Delete original → clone still works
Can't link across different disks
Soft Link = Shortcut to original file
Points to original file location
Delete original → shortcut breaks
Can point anywhere
# Create original file echo "Hello" > original.txt # Create hard link (clone) ln original.txt hardlink.txt # Create soft link (shortcut) ln -s original.txt shortcut.txt # Check both ls -li # Shows they're different
When to use:
Soft links: For shortcuts, version switching
Hard links: For backups, disk space saving
🗂️ File System Hierarchy Explained
Linux Folder Structure:
Linux organizes files in a tree structure starting from / (root):
/ ├── /bin/ # Essential programs (ls, cp, rm) ├── /etc/ # Configuration files (like settings) ├── /home/ # User home folders (your personal space) ├── /var/ # Variable data (logs, databases) ├── /tmp/ # Temporary files (deleted on reboot) ├── /usr/ # User programs (bigger applications) └── /opt/ # Optional software (manually installed)
What Goes Where:
Your files:
/home/yourname/System settings:
/etc/Log files:
/var/log/(system diary)Programs:
/usr/bin/Temporary:
/tmp/(safe to clean)
# Check disk usage df -h # Like checking storage on your phone # Find where a program is installed which python3 # Shows "/usr/bin/python3"
Why This Structure Matters:
As a DevOps engineer, you need to know:
Where to find logs when troubleshooting
Where to put configuration files
Where applications are installed
How to check disk space
Practical Examples for Beginners
Example 1: Setting Up a Web Server
# 1. Install web server sudo apt install nginx # 2. Check it's running systemctl status nginx # 3. View default webpage cat /var/www/html/index.nginx-debian.html # 4. Check logs if something goes wrong tail -f /var/log/nginx/access.log
Example 2: Daily Backup Script
# Create backup script nano ~/backup.sh # Add these lines: #!/bin/bash cp -r /home/myapp/data /backup/data-$(date +%Y%m%d) echo "Backup completed: $(date)" >> /backup/log.txt # Make it executable chmod +x ~/backup.sh # Run it ./backup.sh
Common Problems & Solutions
Problem: "Permission Denied"
Why it happens: You don't have rights to access a file or folder.
Solution:
# Check current permissions ls -l filename # If you own the file: chmod +x filename # Add execute permission # If you don't own it (need admin): sudo chmod +x filename # Enter password if prompted
Problem: "Command Not Found"
Why it happens: Program isn't installed or not in your PATH.
Solution:
# Check if installed which programname # Install it # On Ubuntu: sudo apt install programname # On CentOS: sudo yum install programname
Problem: "No Space Left on Device"
Why it happens: Disk is full.
Solution:
# Check disk space df -h # Find large files du -sh /* | sort -rh | head -5 # Clean up sudo apt clean # Clear package cache sudo rm -rf /tmp/* # Clear temp files (careful!)
📋 Quick Reference Cheat Sheet
| What you want to do | Command | Example |
|---|---|---|
| See where you are | pwd | pwd |
| List files | ls | ls -la |
| Change folder | cd | cd /home |
| Create file | touch | touch notes.txt |
| Create folder | mkdir | mkdir projects |
| View file | cat | cat config.txt |
| Edit file | nano | nano file.txt |
| Copy file | cp | cp file.txt backup/ |
| Move/rename | mv | mv old.txt new.txt |
| Delete file | rm | rm trash.txt |
| Check permissions | ls -l | ls -l script.sh |
| Change permissions | chmod | chmod 755 script.sh |
| Check disk space | df -h | df -h |
| Get help | man | man ls |
🎓 Learning Path Recommendation
Week 1: Master basic navigation (
pwd,ls,cd)Week 2: Learn file operations (
cp,mv,rm)Week 3: Understand permissions (
chmod,chown)Week 4: Practice with real projects
Remember: Everyone starts as a beginner. The key is practice, not perfection.
🔗 Practice Safely with Real Workflows
Want to practice these Linux fundamentals in a safe, guided environment? Try our hands-on labs where you can:
Practice commands without breaking anything
Work through real DevOps scenarios
Get instant feedback on your commands
Build real projects step-by-step
👉 Practice safely with real workflows at SKY Tech:
https://devops.trainwithsky.com
Still Have Questions?
Q: I'm afraid of breaking things. What should I do?
A: Start with a virtual machine or use online Linux playgrounds. You can't break those!
Q: How long to become comfortable with Linux?
A: With 30 minutes daily practice, you'll be comfortable in 1 month, proficient in 3 months.
Q: Do I need to memorize all commands?
A: No! Even experts use Google. Focus on understanding concepts, not memorization.
Have specific questions about Linux basics? Ask in the comments below - we'll explain in simple terms! 👍
Comments
Post a Comment