Linux Tips For Normal Users

By Gurjot Singh Saini | 07 Aug 2022 | (0 Reviews)

Suggest Improvement on Linux Tips For Normal Users Click here



Linux Basics & Daily Usage – Beginner Friendly

This module builds a strong foundation for first-time Linux users. You will understand what Linux is, how it differs from Windows/macOS, and how to use Linux comfortably in daily life.


1.1 What Is Linux? History, Philosophy & Use Cases

Linux is a free and open-source operating system built around the Linux kernel.

Unlike Windows, Linux is community-driven, highly customizable, and used everywhere — from laptops and servers to Android phones and supercomputers.

💡 Linux is not a single OS — it comes in many distributions.

1.2 Linux vs Windows vs macOS (Real Differences)

Feature Linux Windows macOS
Cost Free Paid Included with Apple devices
Customization Very High Limited Moderate
Security Very Strong Target of most malware Strong
✅ Linux gives you control. Windows gives convenience.

1.3 Linux Distributions Explained (Ubuntu, Fedora, Mint)

  • Ubuntu: Beginner-friendly, large community
  • Linux Mint: Windows-like feel
  • Fedora: Modern and developer-focused
💡 A Linux distribution = Linux kernel + desktop + software.

1.4 Desktop Environment vs Window Manager

A Desktop Environment provides a complete visual experience (menus, settings, file manager), while a Window Manager only controls window behavior.

⚠️ Beginners should start with Desktop Environments like GNOME or Cinnamon.

1.5 Linux File System Basics (/home, /etc, /var)

  • /home – Your personal files
  • /etc – System configuration
  • /var – Logs and system data
✅ Linux uses a single unified file system — no C: or D: drives.

1.6 User Files, Hidden Files & Configuration Files

Files starting with a dot (.config, .bashrc) are hidden files used for settings.

💡 Press Ctrl + H to show hidden files.

1.7 Everyday Linux Usage for Normal Users

  • Web browsing & media
  • Office work
  • Software installation via app store
  • Updates without restarting constantly
🚀 Linux is stable, fast, and perfect for daily use.

Installing Linux – Complete Beginner's Guide to Safe Installation

This module provides comprehensive, step-by-step guidance for installing Linux safely and confidently. Whether you're completely new to Linux or have tried installations before, this module covers every detail from preparation to post-installation setup.

📌 Module Overview: Installing an operating system can feel intimidating, but with proper preparation and understanding, it becomes a straightforward process. This module explains every concept, tool, and potential pitfall in beginner-friendly language. By the end, you'll understand not just how to install Linux, but why each step matters.

2.1 Dual Boot vs Full Linux Installation – Pros, Cons & Decision Guide

📌 Core Decision: Before installing Linux, you must decide how you want to run it. This choice depends on your hardware, your needs, and your comfort level.

🖥️ Full Linux Installation (Linux Only)

A full installation means Linux is the only operating system on your computer. The entire hard drive is dedicated to Linux.

✅ Advantages:
  • Maximum Performance: Linux has full access to all hardware resources without sharing with another OS
  • Simpler Setup: No complex partition management or bootloader configuration
  • No Disk Space Wasted: All disk space is available for Linux files and applications
  • Better for Learning: Forces you to fully commit and learn the system
  • No Boot Conflicts: Windows updates won't break your Linux bootloader
  • Ideal for Old Computers: Breathe new life into aging hardware
❌ Disadvantages:
  • No Windows Access: You cannot run Windows applications natively (though Wine/VMs are alternatives)
  • Irreversible Commitment: Requires backing up and wiping all existing data
  • Learning Curve: Must adapt to Linux for all computing tasks
  • Software Compatibility: Some Windows-only software may not have Linux alternatives
💡 Best For: Users with a spare computer, old hardware, or those fully committed to switching to Linux.

🔄 Dual Boot Installation (Linux + Windows)

Dual booting means installing Linux alongside Windows on the same computer. When you start your computer, you choose which operating system to use.

✅ Advantages:
  • Best of Both Worlds: Use Windows for gaming/essential software and Linux for learning/development
  • Safety Net: You always have a working Windows system to fall back on
  • Gradual Transition: Learn Linux at your own pace while keeping Windows familiar
  • Hardware Compatibility: Can test Linux hardware support while keeping Windows as backup
  • File Sharing: Access the same files from both operating systems (with proper partition setup)
❌ Disadvantages:
  • Disk Space Sharing: Must divide your hard drive between both systems
  • Bootloader Complexity: Windows updates can sometimes overwrite the Linux bootloader
  • Time Zone Issues: Windows and Linux handle hardware clock differently (can be fixed)
  • Reboot Required: Cannot run both operating systems simultaneously
  • Partition Risks: Resizing Windows partitions carries a small risk of data loss
⚠️ Important: Always back up your entire Windows system before attempting dual boot!

💻 Alternative: Virtual Machine Installation

For complete beginners, virtual machines offer the safest way to try Linux.

How It Works:

Software like VirtualBox or VMware creates a "virtual computer" inside Windows. Linux runs in a window, sharing resources with your main OS.

✅ Advantages:
  • 100% Safe: Cannot damage your Windows installation
  • No Partitioning: Linux lives in a file, not on disk partitions
  • Simultaneous Use: Run Linux and Windows side by side
  • Snapshots: Save system state and roll back if something breaks
  • Easy Removal: Just delete the virtual machine files
❌ Disadvantages:
  • Performance Overhead: Linux runs slower than on real hardware
  • Limited Hardware Access: Graphics acceleration, USB devices may have limitations
  • Not Suitable for Production: Not ideal for long-term daily use
✅ Recommendation for Absolute Beginners: Start with a virtual machine to learn Linux basics, then consider dual boot or full installation when comfortable.

📊 Comparison Table: Installation Methods

Feature Full Installation Dual Boot Virtual Machine
Safety Medium (wipes disk) Medium (partition risk) Very High
Performance Native (100%) Native (100%) 70-90% of native
Disk Space Needed 20GB+ Windows + 20GB+ 20GB+ file
Hardware Access Full Full Limited
Learning Curve Steep Moderate Gentle
Recommended For Spare PC, committed users Daily drivers, gamers Beginners, testing
🔍 Decision Tree: Which Method Should You Choose?
  • Do you have a spare computer? → Try Full Installation on the spare machine
  • Need Windows for specific software/games? → Choose Dual Boot
  • Just want to try Linux safely? → Start with Virtual Machine
  • Have limited disk space? → Consider Virtual Machine or Full Installation on separate drive
  • Worried about breaking your computer? → Definitely start with Virtual Machine

💡 Pro Tip: Many users start with a virtual machine, progress to dual boot, and eventually switch to full Linux installation as they become comfortable.


2.2 UEFI, Legacy Boot & Secure Boot – Modern PC Boot Systems Explained

📌 Core Concept: Understanding your computer's boot system is essential for successful Linux installation. Modern PCs use UEFI, while older systems use Legacy BIOS. This choice affects how you create bootable USB and partition disks.

🔄 BIOS vs UEFI: The Fundamental Difference

📟 Legacy BIOS (Basic Input/Output System)
  • Age: Developed in 1980s, used until ~2010
  • Partition Scheme: Uses MBR (Master Boot Record)
  • Disk Limit: Cannot boot from disks larger than 2TB
  • Partition Limit: Maximum 4 primary partitions
  • Boot Process: Simple, loads first sector of disk
  • Interface: Text-based, keyboard-only navigation
  • Speed: Slower boot times
💻 UEFI (Unified Extensible Firmware Interface)
  • Age: Standard since ~2010, all modern PCs
  • Partition Scheme: Uses GPT (GUID Partition Table)
  • Disk Limit: Supports disks up to 9.4 zettabytes
  • Partition Limit: Up to 128 primary partitions
  • Boot Process: More complex, reads from EFI System Partition
  • Interface: Graphical, supports mouse, faster navigation
  • Speed: Faster boot times, optimized startup
🔍 How to Check Which Your PC Uses:
Windows: Press Win + R, type msinfo32, look for "BIOS Mode"
Linux: Run ls /sys/firmware/efi – if directory exists, you're using UEFI

🔒 Secure Boot: What It Is and Why It Matters

Secure Boot is a UEFI feature that prevents unauthorized operating systems and malware from loading during startup. It checks that every piece of boot software is digitally signed by trusted keys.

How Secure Boot Affects Linux:
  • Ubuntu and Fedora: Fully support Secure Boot (their bootloaders are signed by Microsoft)
  • Some Distributions: May not have signed bootloaders (Debian, Arch, many others)
  • Dual Boot Impact: Can prevent Linux from booting if not properly configured
  • NVIDIA Drivers: Proprietary drivers may not load with Secure Boot enabled
Your Options:
Option Procedure Security Impact
Disable Secure Boot Enter BIOS/UEFI settings, find Secure Boot option, disable it Reduces boot-time security, but fine for most home users
Use Signed Distributions Install Ubuntu, Fedora, or other signed distros Maintains full security with working Linux
Enroll Custom Keys Advanced: Generate and enroll your own MOK (Machine Owner Key) Highest security, complex setup
⚠️ Important: If you're dual booting with Windows 10/11, do NOT disable Secure Boot permanently if you plan to use Windows. Windows 11 requires Secure Boot. Instead, choose a distribution that supports it.

⚙️ Accessing BIOS/UEFI Settings – Step-by-Step Guide

Method 1: Using Boot Key During Startup

Immediately after turning on your computer, press the appropriate key repeatedly:

Manufacturer Common Key(s)
DellF2, F12
HPEsc, F10, F12
LenovoF1, F2, F12 (ThinkPad: Enter then F1)
AcerF2, Del, F12
AsusF2, Del, Esc
ToshibaF2, F12
SonyF2, F3, F12
Microsoft SurfaceVolume Up + Power
Method 2: From Windows 10/11
  1. Open SettingsUpdate & SecurityRecovery
  2. Under "Advanced startup," click Restart now
  3. Choose TroubleshootAdvanced optionsUEFI Firmware Settings
  4. Click Restart
Important Settings to Check Before Linux Installation:
  • Boot Mode: Should be set to match your installation media (UEFI or Legacy)
  • Secure Boot: Enable/disable based on your distribution choice
  • Fast Boot: Disable this – can prevent USB booting
  • SATA Mode: Should be AHCI, not RAID or Intel RST (common issue!)
  • Boot Order: Ensure USB/DVD is prioritized over hard drive
⚠️ Critical Warning: If your SATA mode is set to "Intel RST" or "RAID," Linux will NOT detect your hard drive during installation. You must change it to "AHCI" in BIOS before installing. This may require reinstalling Windows if changed after installation!

🧩 Common BIOS/UEFI Terms Explained

CSM (Compatibility Support Module)
Enables UEFI to boot legacy BIOS operating systems. Enable this if you're mixing old and new.
Fast Boot
Skips some hardware checks to speed up startup. Disable for Linux installation.
PXE Boot
Network booting – can be disabled to speed up boot if not needed.
TPM (Trusted Platform Module)
Security chip used by Windows 11. Linux supports it, but may require configuration.
VT-x/AMD-V
Hardware virtualization support. Enable this if you plan to use virtual machines.
✅ Quick Checklist Before Installation:
  • ☐ Know your boot mode: UEFI or Legacy BIOS
  • ☐ Secure Boot setting matches your distribution
  • ☐ SATA mode is AHCI (not RAID/RST)
  • ☐ Fast Boot is disabled
  • ☐ Boot order prioritizes USB/DVD
  • ☐ You have backed up important data

2.3 Creating Bootable USB – Complete Guide with Rufus & BalenaEtcher

📌 Core Concept: To install Linux, you need to create a bootable USB drive – a USB stick that your computer can start from. This is different from simply copying the ISO file to USB.

📦 What You'll Need

  • USB Drive: Minimum 4GB (8GB recommended for most distributions)
  • Linux ISO File: Downloaded from official distribution website
  • Bootable USB Creation Tool: Rufus (Windows), BalenaEtcher (All platforms), or dd (Linux)
  • Working Computer: To create the bootable USB
⚠️ Warning: Creating a bootable USB will ERASE ALL DATA on the USB drive. Backup any important files first!

🔧 Method 1: Rufus (Windows – Recommended)

Rufus is the fastest and most reliable tool for Windows users.

Step-by-Step Instructions:
  1. Download Rufus from rufus.ie (portable version recommended – no installation needed)
  2. Insert your USB drive (ensure it's empty or backed up)
  3. Open Rufus (it will automatically detect your USB)
  4. Configure Rufus:
    • Device: Select your USB drive (double-check you have the right one!)
    • Boot selection: Click "SELECT" and choose your Linux ISO file
    • Partition scheme:
      • For UEFI systems: Choose GPT
      • For Legacy BIOS: Choose MBR
      • If unsure, choose MBR (works in most cases)
    • File system: Leave as default (FAT32)
    • Cluster size: Leave as default
  5. Click "START"
  6. Important Dialog Boxes:
    • If asked about "ISOHybrid image" – select "Write in ISO Image mode" (recommended)
    • If warned about formatting – confirm by clicking OK
  7. Wait for completion (status bar at bottom shows progress)
  8. Click "CLOSE" when finished – your bootable USB is ready!
💡 Rufus Pro Tips:
  • Rufus shows a green "READY" when complete
  • Use the portable version – no installation required
  • Rufus is much faster than other tools for large ISOs
  • It automatically handles ISOs larger than 4GB (FAT32 limitation)

🎨 Method 2: BalenaEtcher (All Platforms – Beginner Friendly)

BalenaEtcher works on Windows, macOS, and Linux with a beautiful, simple interface.

Step-by-Step Instructions:
  1. Download BalenaEtcher from balena.io/etcher
  2. Install and open Etcher
  3. Click "Flash from file" and select your Linux ISO
  4. Click "Select target" and choose your USB drive
  5. Click "Flash!" to start the process
  6. Enter administrator password if prompted (on Linux/macOS)
  7. Wait for validation (Etcher automatically verifies the write)
  8. Click "Flash another" or close the app when done
✅ Etcher Advantages:
  • Beautiful, intuitive interface
  • Same experience on all platforms
  • Automatic validation after writing
  • Harder to accidentally select wrong drive
⚠️ Etcher Limitations:
  • Slower than Rufus on Windows
  • No advanced options like persistent storage
  • Cannot write to internal drives (safety feature)

🐧 Method 3: Using dd Command (Linux – Advanced)

For Linux users comfortable with terminal, the dd command is the most direct method.

# First, identify your USB drive (be VERY careful!)
lsblk
# Look for your USB drive – usually /dev/sdb or /dev/sdc

# Unmount any mounted partitions
sudo umount /dev/sdb*

# Write the ISO to USB (replace /dev/sdb with your device!)
sudo dd if=/path/to/linux.iso of=/dev/sdb bs=4M status=progress oflag=sync

# Wait for completion (no progress bar unless status=progress is supported)
# Sync to ensure all data is written
sync
⚠️ CRITICAL WARNING: dd is called "Disk Destroyer" for a reason. One wrong device letter can wipe your entire hard drive! Double-check that /dev/sdX is truly your USB drive, not your system disk.
How to Identify the Correct USB Device:
  • Run lsblk before and after inserting USB – the new device is your USB
  • Check size – a 8GB USB will show as 7.5GB in lsblk
  • Look for device without partitions (/dev/sdb not /dev/sdb1)

🔍 Troubleshooting Bootable USB Issues

Problem: USB Doesn't Boot
  • Secure Boot enabled? Try disabling or using a signed distribution
  • Wrong boot mode? Ensure USB was created for correct mode (UEFI vs Legacy)
  • Fast Boot enabled? Disable in BIOS
  • USB 3.0 issues? Try a USB 2.0 port
  • Corrupted ISO? Verify ISO checksum (see below)
Problem: "Failed to load COM32" or Similar Errors
  • Usually caused by using wrong partition scheme – recreate USB with correct scheme
  • Try a different USB creation tool
Problem: USB Works on Some Computers but Not Others
  • Different computers have different BIOS/UEFI implementations
  • Create USB with "compatibility" mode if available

✅ Verifying Your ISO – Checksums Explained

Before creating your bootable USB, you should verify the ISO integrity to ensure it downloaded correctly and hasn't been tampered with.

What is a Checksum?

A checksum is like a digital fingerprint of a file. The official website provides MD5, SHA-1, or SHA-256 hashes. After downloading, you generate the same hash and compare.

How to Verify:

On Windows (PowerShell):

Get-FileHash .\linux.iso -Algorithm SHA256

On Linux/macOS:

sha256sum linux.iso

Compare the output with the hash on the official download page. They must match exactly.

💡 Always verify checksums! It protects against corrupted downloads and security risks.

2.4 Disk Partitioning Explained for Beginners – No Jargon, Just Understanding

📌 Core Concept: Partitioning is like dividing a large room into smaller rooms. Your hard drive is one big space; partitions are separate sections that can hold different operating systems or data.

🧩 What Are Partitions? The Room Analogy

Imagine your hard drive is a large empty warehouse:

  • Unpartitioned Drive: One huge open space – chaotic and hard to organize
  • Partitions: Building walls to create separate rooms – office, storage, workshop
  • Filesystems: How each room is organized – shelving, filing cabinets, workbenches
  • Mount Points: Doors with signs – "/" for the main room, "/home" for personal stuff

In Linux, everything is a file, and partitions are attached (mounted) to directories. The root partition (/) is like your main living area – essential for the system to function.

📊 Partition Table Types: MBR vs GPT

Before creating partitions, you need a partition table – a map of how the disk is divided.

MBR (Master Boot Record) – Legacy
  • Used with: Legacy BIOS systems
  • Maximum disk size: 2TB
  • Maximum partitions: 4 primary, or 3 primary + extended logical
  • Age: Since 1983, still common
  • Bootloader location: First sector of disk
GPT (GUID Partition Table) – Modern
  • Used with: UEFI systems
  • Maximum disk size: 9.4 zettabytes (effectively unlimited)
  • Maximum partitions: 128 (Windows limit, theoretically more)
  • Redundancy: Stores backup partition table at end of disk
  • Bootloader location: Special EFI System Partition (ESP)
💡 Which to choose?
- UEFI system → GPT
- Legacy BIOS → MBR
- Disk > 2TB → GPT required
- Dual boot with Windows 10/11 → GPT

📁 Essential Linux Partitions Explained

Linux can run on a single partition, but multiple partitions offer benefits:

/ (root) – Essential

The root of the filesystem tree. Contains all system files, programs, and configurations. Minimum 10-15GB, recommended 20-30GB for comfortable use.

/home – User Data (Optional but Recommended)

Contains personal files: documents, downloads, music, configuration files. Separating /home allows you to reinstall Linux without losing personal data. Size depends on your needs – allocate remaining space.

swap – Virtual Memory (Optional but Recommended)

Acts as overflow RAM and supports hibernation. Not a traditional filesystem. Size rule: If RAM ≤ 2GB, swap = 2× RAM; RAM 2-8GB, swap = RAM; RAM > 8GB, swap = 4-8GB or as needed for hibernation.

/boot – Boot Files (Special Case)

Contains kernel and bootloader. Usually 500MB-1GB. Only needed for special setups (encryption, RAID).

EFI System Partition (ESP) – UEFI Only

For UEFI systems. Contains bootloaders. Usually 100-500MB, FAT32 format.

⚙️ Partitioning Scenarios – Real Examples

Scenario 1: Simple Single Partition (Beginners, 120GB SSD)
/dev/sda1: / (root) - 120GB, ext4
(swap file instead of partition – modern approach)

Pros: Simplest, no space wasted. Cons: Reinstalling loses all data.

Scenario 2: Root + Home Separation (Recommended, 500GB HDD)
/dev/sda1: / (root) - 50GB, ext4
/dev/sda2: /home - 430GB, ext4
/dev/sda3: swap - 8GB (if RAM = 8GB)

Pros: Safe reinstalls, organized. Cons: Slightly more complex.

Scenario 3: Dual Boot with Windows (250GB SSD)
/dev/sda1: Windows C: - 100GB, NTFS
/dev/sda2: / (root) - 50GB, ext4
/dev/sda3: /home - 80GB, ext4
/dev/sda4: Shared Data - 20GB, NTFS (for files both OS need)
Scenario 4: Advanced Multi-Partition (Server/Enthusiast)
/dev/sda1: /boot - 1GB, ext2
/dev/sda2: / (root) - 30GB, ext4
/dev/sda3: /home - 200GB, ext4
/dev/sda4: /var - 20GB, ext4 (separate logs)
/dev/sda5: /tmp - 5GB, ext4 (separate temp files)
/dev/sda6: swap - 8GB

🔧 Step-by-Step: Partitioning During Ubuntu Installation

Here's what you'll actually see during installation:

Option 1: "Erase disk and install Ubuntu" (Automatic)
  • Simplest option – wipes entire disk, creates single partition
  • Good for: Full installation, beginners, virtual machines
  • Warning: All existing data on the disk will be lost!
Option 2: "Install Ubuntu alongside Windows" (Automatic Dual Boot)
  • Installer automatically shrinks Windows partition and creates space for Linux
  • Good for: Simple dual boot without manual partitioning
  • Limitation: Less control over partition sizes
Option 3: "Something else" (Manual Partitioning)

Choose this for full control. Here's what to do:

  1. Select free space and click + to add partition
  2. Create root partition:
    • Size: 20000-30000 MB (20-30GB)
    • Type: Primary
    • Location: Beginning
    • Use as: Ext4 journaling file system
    • Mount point: /
  3. Create home partition (optional):
    • Size: Remaining space (or desired size)
    • Use as: Ext4
    • Mount point: /home
  4. Create swap area (optional):
    • Size: Equal to RAM (for hibernation) or 4-8GB
    • Use as: swap area
  5. For UEFI systems: Ensure an EFI System Partition exists (usually created by Windows)
  6. Click Install Now and confirm changes
⚠️ Important: When partitioning manually, double-check device names! Installing to the wrong disk can wipe your Windows installation permanently.

🔍 Common Partitioning Mistakes and How to Avoid Them

Mistake Consequence How to Avoid
Installing to wrong disk Data loss on wrong drive Use lsblk to identify disks; check sizes carefully
No swap space with low RAM System may freeze under memory pressure Always create swap if RAM < 4GB, or use swap file later
Root partition too small Cannot install updates or software Give root at least 20GB, 30GB recommended
Forgetting EFI partition UEFI system won't boot Ensure ESP exists and is mounted at /boot/efi
Incorrect filesystem type Partition not recognized Use ext4 for Linux partitions, FAT32 for EFI
💡 Pro Tips:
  • Take screenshots of your partition layout before making changes
  • Write down which partitions are which
  • Use GParted live CD if you want to partition before installation
  • LVM and encryption are advanced topics – stick to basic partitions as a beginner

2.5 Swap Partition vs Swap File – Memory Management Explained

📌 Core Concept: Swap is like emergency overflow space for your RAM. When physical memory fills up, Linux moves less-used data to swap, keeping your system running smoothly.

💾 Swap Partition – The Traditional Approach

A swap partition is a dedicated partition on your hard drive formatted as swap space (not a filesystem like ext4).

✅ Advantages:
  • Performance: Slightly faster than swap file (contiguous on disk)
  • Reliability: Less fragmentation, stable performance
  • Hibernation: Required for hibernation (suspend-to-disk)
  • Simplicity: Set once, forget forever
  • Isolation: Can't be accidentally overwritten by user files
❌ Disadvantages:
  • Inflexible: Can't resize without repartitioning
  • Space Waste: If you don't need swap, that space is unusable
  • Complex Setup: Requires partitioning during installation
  • Wasted if unused: If you rarely use swap, partition sits idle

📄 Swap File – The Modern Flexible Alternative

A swap file is a regular file within your root or home partition that Linux uses as swap space.

✅ Advantages:
  • Flexible: Easily resize, add, or remove without repartitioning
  • Simple Setup: Create with a few commands after installation
  • No Partitioning: Simplifies disk layout, especially for beginners
  • Space Efficient: File only uses space when actually needed
  • Multiple Swap Files: Can have several for different purposes
❌ Disadvantages:
  • Slightly Slower: May have minor performance overhead
  • Fragmentation: Can become fragmented over time
  • Hibernation Issues: Some setups require special configuration for hibernation with swap file
  • Root Filesystem Dependency: If root fills up, swap may be affected

⚖️ How Much Swap Do You Need? The Complete Guide

The "traditional" rule (swap = 2× RAM) is outdated. Modern systems with plenty of RAM rarely use swap.

RAM Size Swap Size (No Hibernation) Swap Size (With Hibernation) Recommendation
≤ 2GB 2× RAM 3× RAM Essential – create swap partition
2GB – 4GB Equal to RAM 2× RAM Recommended – swap file is fine
4GB – 8GB 4GB – 8GB Equal to RAM Optional – swap file for safety
8GB – 16GB 4GB 8GB – 16GB Minimal – swap file if needed
16GB – 32GB 2GB – 4GB 16GB – 32GB Almost never needed without hibernation
> 32GB 0-2GB Equal to RAM Only for hibernation
💡 Modern Reality: With 8GB+ RAM, many users never use swap in normal operation. A small swap file (2-4GB) provides safety margin without wasting space.

🔧 How to Create a Swap File After Installation

If you didn't create swap during installation, you can easily add a swap file:

# Create a swap file (4GB in this example)
sudo fallocate -l 4G /swapfile
# OR using dd: sudo dd if=/dev/zero of=/swapfile bs=1M count=4096

# Set correct permissions (root only)
sudo chmod 600 /swapfile

# Format as swap
sudo mkswap /swapfile

# Enable the swap file
sudo swapon /swapfile

# Verify it's working
sudo swapon --show
free -h

# Make permanent (add to /etc/fstab)
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
To Disable and Remove Swap File:
sudo swapoff /swapfile
sudo rm /swapfile
# Then remove the line from /etc/fstab

💤 Hibernation (Suspend-to-Disk) Explained

Hibernation saves the contents of RAM to swap and powers off completely. When you turn on your computer, everything is restored exactly as you left it.

Requirements for Hibernation:
  • Swap size must be at least equal to RAM (slightly larger recommended)
  • Swap must be a partition (swap file hibernation is possible but more complex)
  • Kernel parameter: resume=UUID=swap-partition-uuid must be added
  • Initramfs: Must include the resume hook
Check if Hibernation is Available:
sudo systemctl hibernate # Test hibernation
cat /sys/power/state # Look for 'disk' in output
⚠️ Warning: Hibernation can be problematic on some hardware (especially NVIDIA graphics). Test thoroughly before relying on it.
🎯 Recommendation Summary:
  • For beginners: Let the installer create swap automatically (usually a swap file in modern distros)
  • For dual boot with Windows: Use swap file to avoid partition complexity
  • If you need hibernation: Create a swap partition equal to your RAM size
  • If you have limited disk space: Use swap file and set swappiness lower (see below)

2.6 Common Installation Errors & Fixes – Complete Troubleshooting Guide

📌 Core Concept: Even with careful preparation, things can go wrong. This section covers the most common Linux installation errors and how to fix them.

Symptoms: Installer won't proceed, shows this error message.

Cause: You haven't assigned the root mount point (/) to any partition.

Solution:

  1. In the partitioning screen, select the partition you want as root
  2. Click Change or double-click the partition
  3. Set "Use as:" to Ext4 (or your preferred filesystem)
  4. Set "Mount point:" to /
  5. Click OK and continue
💡 Prevention: Always assign mount point / to your main Linux partition.

Symptoms: Installation completes but fails at the end with GRUB error.

Causes:

  • UEFI vs Legacy mismatch
  • Secure Boot blocking GRUB
  • EFI partition missing or wrong format
  • Multiple disks causing confusion

Solutions:

Fix 1: Check Boot Mode
  • Ensure your USB boots in the same mode as your target installation (UEFI or Legacy)
  • In BIOS, disable CSM/Legacy boot for UEFI installation
Fix 2: Secure Boot
  • Temporarily disable Secure Boot in BIOS
  • Install with Secure Boot disabled, then re-enable and enroll MOK if needed
Fix 3: Manual GRUB Installation
# Boot from live USB, chroot into installed system
sudo mount /dev/sdaX /mnt # Your root partition
sudo mount /dev/sdaY /mnt/boot/efi # EFI partition if UEFI
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/sda
update-grub
exit

Symptoms: No wireless networks visible, Wi-Fi option missing.

Causes:

  • Missing proprietary drivers (common with Broadcom, Realtek chips)
  • Hardware switch turned off
  • Kernel too old for very new hardware

Solutions:

Immediate Fix (during installation):
  • Use Ethernet cable temporarily
  • Use phone USB tethering (Android: USB tethering, iPhone: Personal Hotspot via USB)
After Installation (with internet):
# Ubuntu/Debian - Install additional drivers
sudo ubuntu-drivers autoinstall
# Or use Additional Drivers GUI tool

# For Broadcom specifically:
sudo apt install bcmwl-kernel-source

# For Realtek:
sudo apt install rtl8821ce-dkms # (example, depends on chip)
Check Hardware Switch:
  • Some laptops have physical Wi-Fi switch or Fn key combination
  • Run rfkill list to see if soft/hard blocked
  • rfkill unblock wifi to unblock software block

Symptoms: Installer shows no hard drives, or cannot find disks to install to.

Causes:

  • SATA mode set to RAID/Intel RST instead of AHCI
  • NVMe drive not supported by kernel
  • Faulty SATA cable or connection
  • Drive not properly connected or powered

Solutions:

Fix 1: Change SATA Mode to AHCI (Most Common)
  1. Restart and enter BIOS/UEFI
  2. Find SATA Operation, SATA Mode, or similar setting
  3. Change from Intel RST Premium with Optane or RAID to AHCI
  4. Save and exit
⚠️ Windows Warning: If Windows is already installed, changing to AHCI may cause Windows to blue screen. Follow Microsoft's guide to enable AHCI safely, or reinstall Windows after change.
Fix 2: Check Disk Recognition in Terminal
# From live USB terminal:
lsblk # List all block devices
sudo fdisk -l # Detailed partition info
lspci | grep -i sata # Check SATA controller
Fix 3: Load Additional Drivers

Some NVMe drives need extra drivers. Try booting with different kernel parameters:

  • At GRUB menu, press e to edit boot parameters
  • Add pci=realloc or nvme_core.default_ps_max_latency_us=0
  • Press Ctrl+X or F10 to boot

Symptoms: Screen goes black, freezes, or shows garbled graphics after booting from USB.

Causes:

  • NVIDIA graphics card incompatibility
  • Nomodeset parameter needed
  • Resolution too high for display
  • Wayland vs Xorg session issues

Solutions:

Fix 1: Use nomodeset Kernel Parameter
  1. At GRUB menu, highlight "Try Ubuntu" or "Install Ubuntu"
  2. Press e to edit
  3. Find the line ending with quiet splash or ---
  4. Add nomodeset before the --- or after quiet splash
  5. Press Ctrl+X or F10 to boot

Other useful parameters:

  • nouveau.modeset=0 – Disable open-source NVIDIA driver
  • radeon.modeset=0 – For AMD graphics
  • i915.modeset=0 – For Intel graphics
  • noacpi – Disable ACPI (if power management causes issues)
  • nolapic – Disable local APIC
Fix 2: Choose Safe Graphics Mode

Some installers (like Ubuntu) have a "Safe Graphics" option in the GRUB menu – choose this for automatic nomodeset.

Fix 3: Try Different Display Server

At the login screen, click the gear icon and choose "Ubuntu on Xorg" instead of "Ubuntu" (Wayland).

Symptoms: Progress bar stops at a specific percentage, often during package installation or language pack download.

Causes:

  • Network timeout downloading updates
  • Corrupted ISO or USB
  • Insufficient disk space
  • Hardware compatibility issue

Solutions:

Fix 1: Install Without Updates
  1. During installation, uncheck "Download updates while installing"
  2. Also uncheck "Install third-party software" (can add later)
  3. Continue installation
Fix 2: Check USB Integrity
  • Verify ISO checksum
  • Recreate bootable USB with different tool
  • Try different USB port (USB 2.0 preferred)
Fix 3: Check Disk Space

Ensure you've allocated enough space for root partition (at least 15-20GB).

Fix 4: Disable Quiet Splash to See Errors

Remove quiet splash from boot parameters to see where it actually hangs.

Symptoms: After dual boot installation, GRUB only shows Linux, no Windows option.

Causes:

  • OS-prober not running or disabled
  • Windows installed in different boot mode (UEFI vs Legacy)
  • Windows partition damaged

Solutions:

Fix 1: Update GRUB
sudo update-grub
# Or on some systems:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Fix 2: Enable OS Prober (Ubuntu 22.04+)

Newer versions disable OS prober by default. Enable it:

sudo nano /etc/default/grub
# Add this line:
GRUB_DISABLE_OS_PROBER=false
# Save, then:
sudo update-grub
Fix 3: Manually Add Windows Entry

If Windows still doesn't appear, you can manually add it:

sudo nano /etc/grub.d/40_custom
# Add:
menuentry "Windows 10" {
insmod part_gpt
insmod ntfs
set root='(hd0,gpt1)' # Adjust to your Windows partition
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
sudo update-grub

Symptoms: After dual boot, time is wrong in one OS (usually Windows shows wrong time).

Cause: Windows assumes hardware clock is local time; Linux assumes UTC.

Solutions:

Fix 1: Make Linux Use Local Time (Recommended)
timedatectl set-local-rtc 1 --adjust-system-clock
# Verify:
timedatectl | grep local

This tells Linux to treat hardware clock as local time, matching Windows behavior.

Fix 2: Make Windows Use UTC (Registry Edit)
⚠️ Warning: Editing Windows registry incorrectly can break your system. Backup first!
  1. Open regedit as administrator
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
  3. Create new DWORD (32-bit) named RealTimeIsUniversal
  4. Set value to 1
  5. Reboot
🆘 Emergency Recovery Toolkit

Keep these tools handy for serious issues:

  • Boot-Repair-Disk: Live CD that automatically fixes GRUB issues
  • GParted Live: Partition management without installation
  • SystemRescue: Comprehensive recovery toolkit
  • Windows installation USB: For fixing Windows bootloader

2.7 First Boot Checklist – What to Do After Installing Linux

📌 Core Concept: Congratulations! Linux is installed. But your journey is just beginning. This checklist ensures your system is properly configured, secure, and ready for daily use.

✅ Step 1: First Login and System Update

Why it's important: Your installation media may be months old. Updates contain security patches, bug fixes, and newer software versions.

GUI Method:
  • Look for "Software Updater" or "Update Manager" in applications menu
  • Click "Check for Updates" and install everything
  • Restart if kernel updates were installed
Terminal Method (Faster):
# Ubuntu/Debian: sudo apt update sudo apt upgrade -y sudo apt dist-upgrade -y # Optional, handles dependencies sudo apt autoremove -y # Remove unused packages
# Fedora: sudo dnf upgrade --refresh
# Arch: sudo pacman -Syu
💡 Pro Tip: After a fresh install, run updates twice – sometimes the first update updates the package manager itself.

✅ Step 2: Install Additional Drivers

Why it's important: Proprietary drivers (especially for NVIDIA graphics and some Wi-Fi chips) provide better performance and features.

Ubuntu:
  • Open "Software & Updates" from applications menu
  • Go to "Additional Drivers" tab
  • Select proprietary driver (e.g., "Using NVIDIA driver metapackage")
  • Click "Apply Changes" and restart
Terminal Method:
# Ubuntu automatic driver detection sudo ubuntu-drivers autoinstall
# For specific NVIDIA driver sudo apt install nvidia-driver-550 # Version may vary
Check What's Currently Used:
lspci -k | grep -A 2 -E "(VGA|3D)"

✅ Step 3: Install Media Codecs and Essential Software

Why it's important: Legal restrictions often prevent distributions from including multimedia codecs by default.

Ubuntu Restricted Extras:
sudo apt install ubuntu-restricted-extras # Includes: Flash, MP3, DVD playback, fonts, and more # You'll need to accept the EULA for Microsoft fonts
Essential Applications Most Users Install:
  • Web Browser: Chrome, Firefox (usually preinstalled)
  • Office Suite: LibreOffice (usually preinstalled)
  • Media Player: VLC (sudo apt install vlc)
  • Image Editor: GIMP (sudo apt install gimp)
  • PDF Reader: Okular, Evince (preinstalled)
  • Cloud Storage: Nextcloud client, Dropbox
  • Communication: Discord, Slack, Zoom
  • Torrent Client: Transmission (preinstalled)
Install Multiple Apps at Once:
sudo apt install vlc gimp filezilla thunderbird keepassxc

✅ Step 4: Configure Firewall (UFW)

Why it's important: A firewall adds an extra layer of security, especially if you're on public networks.

Enable and Configure UFW:
# Check status sudo ufw status
# Enable firewall (careful with SSH!) sudo ufw enable
# Default rules (good starting point) sudo ufw default deny incoming sudo ufw default allow outgoing
# Allow specific services sudo ufw allow ssh sudo ufw allow 80/tcp # HTTP sudo ufw allow 443/tcp # HTTPS
# Check detailed status sudo ufw status verbose
💡 For desktop users: The default settings (deny incoming, allow outgoing) are usually sufficient.

✅ Step 5: Set Up Backups (Timeshift)

Why it's important: System snapshots let you roll back if an update breaks something.

Install and Configure Timeshift:
# Install Timeshift sudo apt install timeshift
# Launch from applications menu # Or run from terminal: sudo timeshift-gtk
Recommended Settings:
  • Snapshot type: RSYNC
  • Location: Choose a partition with enough space (separate from root if possible)
  • Schedule: Daily (keep 5), Weekly (keep 3), Monthly (keep 2)
  • Include: Only system files, exclude /home (use separate backup for personal files)
For Personal Files:
  • Déjà Dup (built into GNOME) – simple encrypted backups
  • rsync – manual but powerful
  • Cloud sync: Nextcloud, Dropbox, Google Drive

✅ Step 6: Configure Power Management

Why it's important: Optimize battery life for laptops and performance for desktops.

Laptop Users: Install TLP
sudo apt install tlp tlp-rdw sudo systemctl enable tlp sudo tlp start
# Check status sudo tlp-stat -s
Check Battery Health:
upower -i /org/freedesktop/UPower/devices/battery_BAT0
Configure Lid Close Behavior:

Edit /etc/systemd/logind.conf and set:

HandleLidSwitch=suspend HandleLidSwitchExternalPower=lock # Different when plugged in

Then restart service: sudo systemctl restart systemd-logind

✅ Step 7: Customize Your Desktop Environment

Why it's important: Make Linux feel like home with your preferred look and workflow.

GNOME (Ubuntu Default):
  • Extensions: sudo apt install gnome-shell-extensions
  • GNOME Tweaks: sudo apt install gnome-tweaks
  • Extension Manager: Install from Ubuntu Software
  • Popular extensions: Dash to Dock, User Themes, Clipboard Indicator
KDE Plasma (Kubuntu):
  • System Settings → Appearance – endless customization
  • Get New Widgets, Themes, Icons from online
Cinnamon (Linux Mint):
  • System Settings → Themes – easy theming
  • Applets and Desklets for extra functionality
Essential Customizations for Everyone:
  • Dark Mode: Settings → Appearance → Dark
  • Night Light: Settings → Displays → Night Light (reduce blue light)
  • Workspaces: Enable and configure in Settings → Multitasking
  • Keyboard Shortcuts: Settings → Keyboard → View and Customize

✅ Step 8: Set Up Printing and Scanning

Why it's important: Most printers work out of the box, but some need driver installation.

Printer Setup:
  • Go to Settings → Printers
  • Click "Add Printer"
  • If detected, select and add
  • If not, you may need to install drivers:
    sudo apt install printer-driver-* # Install all common drivers
    sudo apt install hplip # HP printers
    sudo apt install gutenprint # Canon, Epson, others
Scanner Setup:
sudo apt install simple-scan # Document Scanner app
sudo apt install sane-utils # Scanner backend

✅ Step 9: Configure Automatic Security Updates

Why it's important: Keep your system secure without manual intervention.

Enable Unattended Upgrades:
sudo apt install unattended-upgrades sudo dpkg-reconfigure --priority=low unattended-upgrades # Answer "Yes" to automatically install updates
Check Configuration:

Edit /etc/apt/apt.conf.d/50unattended-upgrades to customize which updates are installed automatically.

View Logs:
cat /var/log/unattended-upgrades/unattended-upgrades.log

✅ Step 10: Install System Monitoring Tools

Why it's important: Understand your system's performance and resource usage.

GUI Monitoring Tools:
sudo apt install gnome-system-monitor # Task manager
sudo apt install hardinfo # System profiler
sudo apt install gkrellm # Lightweight system monitor
Terminal Monitoring Tools:
sudo apt install htop # Better top
sudo apt install btop # Modern resource monitor
sudo apt install nethogs # Monitor network per process
sudo apt install iotop # Monitor disk I/O

📋 Quick Reference: First Boot Checklist

Immediate (First 10 Minutes):
  • ☐ Connect to internet
  • ☐ Run system updates
  • ☐ Install additional drivers
  • ☐ Install multimedia codecs
  • ☐ Enable firewall (UFW)
Within First Hour:
  • ☐ Set up Timeshift backups
  • ☐ Install essential applications
  • ☐ Configure power management
  • ☐ Customize desktop appearance
  • ☐ Set up printer/scanner
Within First Day:
  • ☐ Enable automatic security updates
  • ☐ Install monitoring tools
  • ☐ Configure email client
  • ☐ Set up cloud storage sync
Ongoing Maintenance:
  • ☐ Weekly: sudo apt update && sudo apt upgrade
  • ☐ Monthly: Check Timeshift snapshots
  • ☐ As needed: Clean up old kernels
🎉 Congratulations! Your Linux System Is Ready

You've successfully installed Linux and completed all essential post-installation steps. Your system is now secure, up-to-date, and customized for daily use. Welcome to the Linux community!

📚 Next Steps:
  • Explore the Terminal & Command Line module to master Linux basics
  • Learn about software management in the next module
  • Join Linux communities: r/linuxquestions, Ubuntu Forums, Ask Ubuntu
  • Don't be afraid to experiment – that's how you learn!

📌 Module 02 Summary: Installing Linux

You've completed the comprehensive Linux installation module. Here's what you've learned:

Installation Methods
  • Full installation vs Dual boot vs VM
  • Pros and cons of each approach
  • Decision guide for beginners
Boot Systems
  • UEFI vs Legacy BIOS
  • Secure Boot implications
  • Accessing BIOS settings
USB Creation
  • Rufus (Windows)
  • BalenaEtcher (All platforms)
  • dd command (Linux)
  • Checksum verification
Disk Partitioning
  • MBR vs GPT
  • Root, home, swap partitions
  • Partitioning scenarios
  • Common mistakes
Swap Management
  • Swap partition vs swap file
  • How much swap you need
  • Creating swap after install
  • Hibernation requirements
Troubleshooting
  • 8 common installation errors
  • Step-by-step fixes
  • Emergency recovery tools
  • Dual boot time fix
First Boot Checklist (10 Essential Steps)
  • System updates, drivers, codecs, essential apps
  • Firewall, backups, power management
  • Desktop customization, printing, automatic updates
  • Monitoring tools and ongoing maintenance
💡 Key Takeaway: Successful Linux installation is about preparation, understanding, and methodical execution. Take your time, read carefully, and don't hesitate to research if something doesn't work. Every problem has a solution!

🐧 Module 03 : Linux Desktop, Apps & Software

📌 Module Overview (depth edition): Moving from Windows or macOS to Linux means rethinking how you install, update, and remove software. Linux offers a unique universe of package managers, repository structures, sandboxed formats, and thousands of open‑source alternatives. This module expands every sub‑topic with more than 1500 words of practical insight, command examples, real‑world pitfalls, and comparisons. By the end you will master the Linux software ecosystem without breaking your system.

3.1 How Software Works in Linux — packages, deps & the philosophy

📌 Core concept: Unlike monolithic installers, Linux treats software as collections of interdependent packages. This design enables efficient updates, shared libraries, and security maintenance.
🧩 The package + dependency model

Every Linux distribution is built around a package format. A package is an archive containing executable files, configuration files, documentation, and metadata (name, version, dependencies, conflicts). The most common are .deb (Debian/Ubuntu) and .rpm (Red Hat/Fedora). The metadata declares which shared libraries (libc.so.6, libgtk-3.so.0) are required. The package manager reads these declarations and installs missing dependencies automatically from repositories.

Why shared libraries? Instead of each application bundling its own copy of, say, a JPEG loader, they all use the system’s libjpeg. This reduces disk usage and allows one security update to fix dozens of apps. However, it creates the famous dependency hell when two applications need different versions of the same library — that’s where modern package managers and sandboxed formats (Flatpak, Snap) shine.

📊 Example: GIMP dependencies (simplified)
gimp (2.10.30-1) depends on:
 ├─ libc6 (>= 2.33)          [core C library]
 ├─ libgegl-0.4-0 (>= 0.4.32) [image processing]
 ├─ libgdk-pixbuf-2.0-0       [GTK image loading]
 ├─ libgtk-3-0 (>= 3.24)      [GUI toolkit]
 └─ … 40+ more
                                     

apt install gimp fetches every missing piece. The same applies to rpm-based distros with dnf. This is why you never download a single .deb from a random site and double‑click — if it was built for a different release, dependencies may not match, leading to broken system state.

💡 pro tip: use apt-cache depends gimp (or dnf deplist gimp) to see the full dependency tree before installing.
🔁 Binary packages vs source compilation

Most users install pre‑compiled binary packages. Some distributions (Gentoo, Source‑based) compile everything from source code on your machine. Even on Ubuntu, you can compile from source using ./configure && make && sudo make install, but it’s not recommended because the package manager loses track of those files — later updates or removals become messy. Always prefer binary packages.


3.2 Linux “App Store” vs Package Manager — GUI front‑end vs CLI engine

🖥️ The graphical software centers (GNOME Software, KDE Discover, Pop!_Shop)

Modern Linux desktops include friendly app stores: they display applications with screenshots, user reviews, and one‑click install. Under the hood, they are front‑ends to the same package managers (apt, dnf, etc.) plus Flatpak and Snap. For example, GNOME Software uses PackageKit, which abstracts distro differences. These tools are perfect for casual users: they handle authentication, show progress, and integrate with system updates.

But they hide complexity: you cannot easily see exactly which packages will be installed, pin versions, or fix broken dependencies from the GUI. If the GUI crashes during an operation, you might need the terminal to recover.

⌨️ Command‑line package managers — apt, dnf, pacman

The command line provides surgical control. With apt you can:

  • apt search <term> – search packages
  • apt show <pkg> – detailed metadata
  • apt list --installed – see everything
  • apt upgrade --dry-run – preview changes
  • apt-mark hold <pkg> – prevent updates

Advanced tasks like pinning (priority control) or downloading source packages are only possible via CLI. Moreover, in server environments there is no GUI at all.

TaskGUI (Discover/Software)CLI (apt)
Install appclick "install"sudo apt install firefox
Remove & config"remove" (often leaves config)sudo apt purge firefox
Update all"update all" buttonsudo apt update && sudo apt upgrade -y
Fix brokensometimes offers repairsudo apt --fix-broken install

Real mastery means being comfortable with both — the GUI for discovery, the CLI for reliability.

📌 3.2 recap

3.3 Installing & Removing Software Safely (without breaking your system)

✅ Trust hierarchy: official repos → PPAs → .deb from vendor → other sources

1. Distribution repositories (main/restricted/universe/multiverse): millions of packages, tested for the release. Use apt install directly. Example: sudo apt install vlc.

2. PPAs (Personal Package Archives): for newer versions (e.g., ppa:libreoffice/ppa). Add with sudo add-apt-repository ppa:libreoffice/ppa && sudo apt update. Only use trusted PPAs (check launchpad.net reputation).

3. Official .deb packages from developers (Chrome, Zoom, VS Code). Download and install with sudo apt install ./google-chrome.deb. This respects dependencies. Do not use dpkg -i alone because it won’t fetch missing dependencies — always apt install on the .deb file.

4. Manual compilation / random binaries — highest risk, only if no other option.

❌ Removal: remove vs purge vs autoremove
  • sudo apt remove vlc – deletes binaries, keeps config files (/etc/vlc).
  • sudo apt purge vlc – wipes config as well.
  • sudo apt autoremove – cleans up libraries that were installed as dependencies and are no longer needed (run after removals).

To remove a PPA: sudo add-apt-repository --remove ppa:name or delete the .list file in /etc/apt/sources.list.d/.

🛠️ fixing broken installs
  • sudo apt --fix-broken install – resolves dependency conflicts.
  • sudo dpkg --configure -a – if dpkg was interrupted.
  • If a bad PPA breaks update, disable it by moving its .list file and run sudo apt update.
📌 3.3 recap

3.4 Flatpak, Snap & AppImage — universal formats explained

📦 Flatpak – the community favourite

Flatpak bundles an app with its own dependencies in a sandbox, yet shares common runtimes (like Freedesktop 22.08) to save space. Apps run confined; you control permissions via flatpak override or Flatseal. Main repo: Flathub (flathub.org). Commands:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.gimp.GIMP
flatpak run org.gimp.GIMP

Flatpak apps integrate with the desktop (themes, portals) and can be updated with flatpak update. Ideal for GUI apps.

📦 Snap – by Canonical (Ubuntu native)

Similar container concept but with stricter mandatory updates. Snap packages are transactional and roll back automatically if an update fails. Commands: snap install gimp, snap refresh, snap remove gimp. They auto‑update every day (can be changed). Some criticize centralization and slower start. Good for CLI tools and server apps too.

📦 AppImage – one file = one app

No installation: download, chmod +x App, run. Ideal for portable usage or trying software without committing. No sandbox, no automatic updates. Can be integrated with tools like AppImageLauncher. Great for older distributions that lack recent packages.

⚖️ comparison table
FeatureFlatpakSnapAppImage
Sandbox✅ fine-grained✅ strict (AppArmor)
Auto‑updateoptional (systemd timer)forced by defaultmanual
Sharing runtimeyes (runtimes)yes (core)no (each app standalone)
Main repoFlathubSnap Storenone (direct download)

3.5 Trusted Repositories & Software Sources — where packages come from

🔐 sources.list and GPG keys

/etc/apt/sources.list and files under /etc/apt/sources.list.d/ define which repositories apt uses. A typical line: deb http://archive.ubuntu.com/ubuntu jammy main restricted. The GPG key (downloaded separately) ensures packages haven't been tampered with. When you add a PPA, add-apt-repository installs both the entry and the key.

Never add a repo without verifying its key fingerprint. For third‑party repos like Docker, you follow official instructions that include the key fingerprint.

➕ adding a PPA (step by step)
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

Now you can install nvidia driver updates from that PPA. To remove: sudo add-apt-repository --remove ppa:graphics-drivers/ppa.


3.6 Windows Software Alternatives on Linux

🪟 replacing everyday apps
Windows appLinux alternative(s)Install method
Microsoft OfficeLibreOffice, OnlyOffice, WPS Officeapt / flatpak
Adobe PhotoshopGIMP, Kritaapt / flatpak
Adobe IllustratorInkscapeapt / flatpak
Adobe PremiereKdenlive, DaVinci Resolve, Shotcutflatpak / .deb (resolve)
OutlookThunderbird, Evolutionapt
Visiodraw.io, Diasnap / flatpak
NotePad++Kate, Geany, VS Codiumapt / flatpak
SpotifySpotify (client)snap / flatpak
Zoom / TeamsZoom .deb, Teams (PWA / unofficial)deb / flatpak

For apps that have no native version, consider Wine or Bottles (Flatpak) to run Windows software, but expect some friction. Virtual machines are another option.


3.7 Updating Linux Without Breaking the System

🛡️ update rituals & precautions
  • Before upgrading, run apt list --upgradable to see what will change.
  • Use apt upgrade (never dist-upgrade unless you understand it).
  • Hold back critical packages: sudo apt-mark hold linux-image-generic
  • Use Timeshift to take filesystem snapshots before large updates.
  • Enable automatic security updates via unattended-upgrades.

3.8 Updating Linux Using apt (update & upgrade) — the definitive guide

🔄 apt update: refreshes package list

sudo apt update downloads the latest package lists from all configured repositories. It does not install anything — it simply tells your system what new versions are available. Always run this before any install or upgrade.

⬆️ apt upgrade: safe package upgrade

sudo apt upgrade installs newer versions of packages you already have, but it never removes packages. If a new version requires a dependency that must be removed, the upgrade is held back. To see held packages: apt-mark showhold.

📈 apt full-upgrade (dist-upgrade)

sudo apt full-upgrade performs the same as upgrade but will remove packages if necessary to complete the upgrade. This is useful when switching between major releases (e.g., Ubuntu 22.04 → 22.10) but can be risky on a stable system — run it only when you intend to allow removals.

Standard daily driver: sudo apt update && sudo apt upgrade -y.

🧪 dry‑run & logs

Always simulate: apt upgrade --dry-run shows what would happen. Logs are stored in /var/log/apt/history.log.


Module 04 : Terminal & Command Line (Beginner)

This module introduces the Linux terminal - the powerful command-line interface that gives you complete control over your system. Learn essential commands, shortcuts, and best practices to become productive in the terminal.


4.1 What Is Terminal & Why Linux Uses It

The Terminal (also called console or command line) is a text-based interface to control your computer.

Unlike graphical interfaces, the terminal gives you direct access to the system, allowing you to perform complex tasks quickly with just a few keystrokes.

🎯 Why Terminal is Powerful:
  • Speed: Faster than clicking through menus
  • Automation: Script repetitive tasks
  • Power: Access advanced system features
  • Remote Access: Control servers over SSH
  • Consistency: Same commands work across different Linux systems
💡 Quick Tip: Open terminal with Ctrl + Alt + T (in most Linux distributions)
✅ Don't be intimidated! Terminal is just another way to talk to your computer - like learning a new language.

4.2 Understanding Shells (bash, zsh)

A Shell is the program that interprets your commands in the terminal. It's your interface to the operating system.

🐚 Common Shell Types:
Shell Description Best For Default Color
bash Bourne Again SHell - Most common, default on most systems Beginners & compatibility Blue prompt
zsh Z Shell - Feature-rich with autocomplete & themes Power users & customization Green prompt
fish Friendly Interactive SHell - User-friendly with syntax highlighting Those who want modern features Yellow prompt
🔍 How to Check Your Current Shell:
# Check which shell you're using
echo $SHELL
# Output example: /bin/bash

# See all available shells on your system
cat /etc/shells
⚠️ Beginner Recommendation: Start with bash - it's everywhere and has the most learning resources.
💡 Pro Tip: Your shell prompt (e.g., user@computer:~$) shows your username, computer name, and current directory.

4.3 Basic Commands (ls, cd, pwd, clear)

These four commands are the foundation of Linux navigation. Master these, and you can explore anywhere!

🚀 The Essential Four:
Command What It Does Basic Usage Common Options
pwd Print Working Directory - Shows where you are pwd (no options)
ls List files and directories ls -l (details), -a (all), -h (human readable)
cd Change Directory - Move to different folder cd folder_name cd .. (go up), cd ~ (go home)
clear Clear screen - Makes terminal empty clear Ctrl + L (keyboard shortcut)
🎮 Hands-On Practice:
# 1. See where you are
pwd
# Output: /home/your_username

# 2. List files in current directory
ls
ls -la # List all files with details

# 3. Navigate to Documents folder
cd Documents
pwd # Now shows: /home/your_username/Documents

# 4. Go back home
cd ~
# OR simply: cd

# 5. Clean up the screen
clear
Success Tip: Type these commands yourself! Muscle memory is key to learning terminal.
💡 Remember: Linux is case-sensitive! DocumentsdocumentsDOCUMENTS

4.4 Working with Files & Directories

Now that you can navigate, let's learn how to create and organize your files and folders.

📁 File & Directory Management Commands:
Command Purpose Example What Happens
mkdir Make Directory (create folder) mkdir my_folder Creates "my_folder"
touch Create empty file touch file.txt Creates "file.txt" (0 bytes)
cat View file contents cat file.txt Shows file content
nano Simple text editor nano notes.txt Opens editor to create/edit
rmdir Remove empty directory rmdir empty_folder Deletes empty folder
🛠️ Practical Example - Organize Your Files:
# Create a project structure
mkdir my_project
cd my_project

# Create subfolders
mkdir docs images code
ls # Shows: docs images code

# Create files
touch README.txt
cd docs
touch notes.txt

# Add content to a file
echo "Project started on $(date)" > notes.txt
cat notes.txt # View the content

# Edit with nano
nano notes.txt
# Add more text, then Ctrl+X to save and exit
📝 Nano Editor Basics:
Nano Cheat Sheet:
Ctrl + O : Save file
Ctrl + X : Exit Nano
Ctrl + K : Cut line
Ctrl + U : Paste line
Ctrl + W : Search
Ctrl + \ : Replace
All shortcuts shown at bottom of screen
Good Practice: Use meaningful names (avoid spaces - use underscores or hyphens instead)

4.5 Copy, Move & Delete Safely

These commands manipulate files. Be careful with delete - there's no "Recycle Bin" in terminal!

⚠️ Safety First - The Dangerous Commands:
Command Purpose Safe Version Danger Level
cp Copy files/directories cp -i file1 file2 Low
mv Move or rename files mv -i old new Medium
rm Remove (delete) files rm -i file.txt HIGH
rm -rf / NEVER USE THIS! Just don't SUICIDE
🔧 Safe Operations with Examples:
# COPYING FILES
cp file.txt file_backup.txt # Basic copy
cp -i file.txt file_backup.txt # Ask before overwriting
cp -r folder/ backup/ # Copy folder recursively

# MOVING/RENAMING
mv file.txt new_name.txt # Rename file
mv file.txt Documents/ # Move to folder
mv -i old.txt new.txt # Ask before overwrite

# DELETING (BE CAREFUL!)
rm file.txt # Delete single file
rm -i important.txt # ASK before deleting
rm -r old_folder/ # Delete folder with contents
rmdir empty_folder/ # Delete ONLY if empty
🛡️ Safety Aliases (Add to ~/.bashrc):
# Make commands ask before doing dangerous things
alias cp='cp -i' # Ask before overwriting copy
alias mv='mv -i' # Ask before overwriting move
alias rm='rm -i' # ASK before deleting anything

# Prevent accidental deletion of system files
alias rm='rm -I --preserve-root'
⚠️ CRITICAL WARNING: Never run rm -rf / or rm -rf /* - it will delete EVERYTHING on your system!
💡 Recovery Tip: If you accidentally delete something, check if it's in ~/.local/share/Trash (GUI deletions) or use file recovery tools immediately.

4.6 Command History, Autocomplete & Shortcuts

These productivity features will make you 10x faster in the terminal. Learn them early!

📜 Command History - Your Time Machine:
# View command history
history # Shows all commands you've typed
history 10 # Show last 10 commands
!45 # Run command #45 from history
!! # Run last command again
!ls # Run last 'ls' command
Ctrl + R # Search history (reverse-i-search)
# Type to search, press Enter to run, Ctrl+C to cancel
🚀 Tab Autocomplete - Your Best Friend:
Tab Key Magic:
• Type cd Docu then press Tab → completes to cd Documents/
• Press Tab twice → shows all possible completions
• Works for commands, files, folders, and options!
⌨️ Essential Keyboard Shortcuts:
Shortcut Action Why It's Useful
Tab Auto-complete Saves typing, prevents typos
Ctrl + A Move cursor to beginning Quick edit long commands
Ctrl + E Move cursor to end Add arguments quickly
Ctrl + U Cut to beginning Clear current command
Ctrl + K Cut to end Remove rest of line
Ctrl + Y Paste cut text Undo Ctrl+U/K cuts
Ctrl + R Search history Find old commands fast
Ctrl + C Cancel/stop command Stop running programs
Ctrl + D Exit shell/logout Close terminal session
Ctrl + L Clear screen Better than typing 'clear'
↑ / ↓ Navigate history Cycle through past commands
💡 Pro Tip: Use Ctrl + R to find commands. Type a few letters of what you remember, and it will search your history.
🎮 Practice Exercise:
# 1. Type this long command:
echo "Hello this is a long command to practice shortcuts"

# 2. Press Ctrl+A to go to beginning
# 3. Press Ctrl+K to cut everything
# 4. Type: ls -la
# 5. Press Ctrl+Y to paste back the echo command
# 6. Press Ctrl+C to cancel

# Practice tab completion:
cd /usr/share/ # Then press Tab multiple times
ls /e # Press Tab → completes to /etc/
Mastery Goal: Use Tab for everything! It's the single biggest productivity boost in terminal.

4.7 Linux Aliases - Custom Command Shortcuts

Aliases are your personal command shortcuts - create custom names for frequently used commands!

🎯 Why Create Aliases?
  • Save Time: Shorten ls -la to just ll
  • Reduce Errors: Avoid typos in complex commands
  • Create Workflows: Chain multiple commands together
  • Personalize: Build your own command language
🔧 Creating Aliases:
# Temporary alias (lasts only this session)
alias ll='ls -la'
ll # Now works as ls -la!

# Permanent alias (add to ~/.bashrc)
nano ~/.bashrc
# Add at bottom:
alias ll='ls -la'
alias update='sudo apt update && sudo apt upgrade'
alias cl='clear'
alias ..='cd ..'
# Save (Ctrl+X, Y, Enter) then reload: source ~/.bashrc
🌟 Useful Beginner Aliases:
# Navigation
alias home='cd ~'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'

# Listing
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -la'
alias lh='ls -lh'

# Safety first!
alias rm='rm -i' # Ask before deleting
alias cp='cp -i' # Ask before overwriting
alias mv='mv -i' # Ask before moving

# System info
alias cpu='top -o %CPU'
alias mem='top -o %MEM'
alias disk='df -h'
alias space='du -sh * | sort -h'
🛠️ Managing Your Aliases:
# List all current aliases
alias
# OR: alias -p

# Check specific alias
type ll
# Output: ll is aliased to `ls -la`

# Remove an alias
unalias ll

# Create separate alias file (recommended)
nano ~/.bash_aliases
# Add all aliases here, then add this to ~/.bashrc:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
🎮 Hands-On Exercise:
# 1. Create a test alias
alias greet='echo "Hello from your alias!"'
greet # Should show greeting

# 2. Create update shortcut
alias update-system='sudo apt update && sudo apt upgrade -y'

# 3. Make it permanent
echo 'alias ll="ls -la"' >> ~/.bashrc
echo 'alias update="sudo apt update && sudo apt upgrade -y"' >> ~/.bashrc
source ~/.bashrc # Reload

# 4. Test your new powers!
ll ~/Documents
# (Might need sudo for update if not Ubuntu/Debian)
Alias Progression: Start with 2-3 aliases, add more as you discover commands you use frequently.
⚠️ Common Mistake: Aliases are user-specific. If you create a new user account, you need to set up aliases again.

4.8 Common Beginner Terminal Mistakes

Everyone makes mistakes when learning terminal. Here's how to avoid (and recover from) the most common ones.

🚫 Top 10 Terminal Mistakes & Solutions:
Mistake Why It Happens How to Avoid How to Fix
rm -rf / Thinking it will "remove folder root" NEVER type this. Use aliases for safety Too late. Reinstall OS.
Wrong case: Documents vs documents Linux is case-sensitive Use Tab to autocomplete Check spelling and case
Spaces in file names without quotes touch my file.txt creates TWO files Use underscores: my_file.txt Use quotes: touch "my file.txt"
Forgetting sudo Need admin rights for system changes Error will tell you "Permission denied" Add sudo before command
Using wrong slash: \ vs / Windows uses backslash, Linux uses forward Linux always uses / Replace \ with /
Command not found Typo or package not installed Use Tab, check spelling Install package: sudo apt install package_name
Accidental Ctrl + D Meant to cancel but exited terminal Use Ctrl + C to cancel Just reopen terminal
Forgetting to cd into folder Running command in wrong directory Always check with pwd first cd to correct folder
Missing arguments rm needs file name Read error messages carefully Add required arguments
Running command as wrong user Need sudo or different user Check who you are: whoami Use sudo or switch user
🔧 Recovery Techniques:
# 1. Stuck in a program?
Press: Ctrl + C # Cancel current command
Press: Ctrl + Z # Pause program (bg/fg to manage)
Press: Ctrl + D # Send EOF (may exit)

# 2. Typed wrong command?
Press: Ctrl + C # Stop it immediately
Use: history # Find correct command
Use: !! # Rerun last command

# 3. Deleted wrong file?
# Check trash: ls ~/.local/share/Trash/files/
# Use recovery tools immediately (testdisk, photorec)

# 4. Lost in filesystem?
pwd # Where am I?
cd ~ # Go home
cd / # Go to root
cd - # Go to previous directory
🛡️ Preventive Safety Measures:
# 1. Create safety aliases in ~/.bashrc
alias rm='rm -i' # Ask before delete
alias cp='cp -i' # Ask before overwrite
alias mv='mv -i' # Ask before move

# 2. Backup important files regularly
cp important.txt important.txt.backup
# OR use version control: git init

# 3. Test commands with echo first
echo rm *.txt # Shows what WOULD be deleted
# Then remove 'echo' to actually run

# 4. Use dry-run options when available
rsync -nav source/ destination/ # -n = dry run
🎮 Practice - Making (Safe) Mistakes:
# Create a safe practice area
mkdir ~/terminal_practice
cd ~/terminal_practice
touch file1.txt file2.txt file3.txt

# Practice common scenarios
# 1. Case sensitivity
ls FILE1.TXT # Fails - wrong case
ls file1.txt # Works

# 2. Spaces in names
touch "my document.txt" # Use quotes
ls my\ document.txt # OR use backslash

# 3. Permission errors
mkdir /system_folder # Fails - need sudo
sudo mkdir /system_folder # Works with sudo

# 4. Tab completion
ls f # Completes to file
ls fi # Shows all matches

# Clean up
cd ~
rm -r terminal_practice/
Golden Rule: If you're about to run a command with rm, format, or dd - STOP. Double-check everything.
💡 Learning Mindset: Every expert was once a beginner who made mistakes. The key is to make them in a safe environment and learn from them!

Internet, Browsers & Networking – Connectivity Mastery

This module covers everything about staying connected on Linux. You'll learn how to manage browsers, fix network issues, use Bluetooth devices, and secure your connection with firewalls and VPNs.


6.1 Browsers on Linux (Firefox, Chrome)

Linux supports all major browsers. Firefox is usually pre-installed and optimized for Linux, while Google Chrome and Chromium are available for download.

  • Firefox: Default on most distributions, privacy-focused
  • Chrome: Available as .deb or .rpm package
  • Chromium: Open-source version of Chrome
  • Brave: Privacy browser with built-in ad blocking
💡 Firefox on Linux supports hardware acceleration and Wayland for better performance.

6.2 Network Manager Explained

NetworkManager is the default networking service on most Linux distributions. It manages Wi-Fi, Ethernet, VPN, and mobile broadband connections through both GUI and CLI.

Tool Purpose How to Access
nm-applet System tray network icon Click system tray icon
nmtui Text-based UI for terminal Run nmtui in terminal
nmcli Command-line interface Run nmcli commands
✅ Use nmtui when GUI isn't working – it's a lifesaver!

6.3 Wi-Fi & Ethernet Troubleshooting

Network issues are common but usually easy to fix. Follow this troubleshooting checklist:

  1. Check if Wi-Fi is enabled: Look for airplane mode or hardware switch
  2. Verify driver installation: Run lspci -k | grep -A 2 -i network
  3. Restart NetworkManager: sudo systemctl restart NetworkManager
  4. Check connection details: ip addr show or ifconfig
  5. Test DNS: ping 8.8.8.8 (if this works but websites don't, it's DNS)
⚠️ Some Wi-Fi cards need proprietary drivers. Use "Additional Drivers" tool on Ubuntu.

6.4 Bluetooth Setup & Troubleshooting

Linux has excellent Bluetooth support for headphones, speakers, mice, and keyboards. Most distributions include Bluez (the standard Bluetooth stack).

Quick Setup:
  • Ensure Bluetooth is enabled: Click system tray icon or check settings
  • Put your device in pairing mode
  • Search for devices and connect
Complete Bluetooth Installation & Setup:
Task Command Purpose
Install Bluetooth stack sudo apt install bluez* Install all Bluez packages
Install Bluetooth manager sudo apt install blueman GUI tool for Bluetooth management
Enable Bluetooth service sudo systemctl enable bluetooth.service Start Bluetooth on boot
Start Bluetooth service sudo systemctl start bluetooth.service Start Bluetooth immediately
Check service status sudo systemctl status bluetooth.service Verify Bluetooth is running
Common Issues & Fixes:
Problem Solution Description
Bluetooth not showing in GUI sudo systemctl start bluetooth Start the Bluetooth service
Device not found bluetoothctl then scan on Use command-line tool to search
Audio quality poor sudo apt install pulseaudio-module-bluetooth
pulseaudio -k
Install Bluetooth audio support & restart PulseAudio
Connection drops frequently sudo btmgmt power off
sudo hciconfig hci0 up
Disable power saving & bring interface up
Missing Bluetooth packages sudo apt install aptitude
sudo aptitude install bluetooth
Use aptitude for better dependency handling
Bluetooth service won't start sudo /etc/init.d/bluetooth restart
service bluetooth restart
Alternative service restart commands
Bluetooth not enabled at boot sudo systemctl enable bluetooth
Check: systemctl is-enabled bluetooth
Ensure Bluetooth starts automatically
Step-by-Step Troubleshooting Guide:
  1. Check if Bluetooth adapter is detected:
    lsusb | grep -i bluetooth
    hciconfig -a
    bluetoothctl list
                                         
  2. Enable and start the service:
    sudo systemctl enable bluetooth
    sudo systemctl start bluetooth
    sudo systemctl status bluetooth
  3. Install missing packages:
    sudo apt update
    sudo apt install bluez blueman bluez-tools
    sudo apt install pulseaudio-module-bluetooth
                                         
  4. Using bluetoothctl (command-line tool):
    bluetoothctl          # Enter Bluetooth control
    power on              # Turn Bluetooth on
    agent on              # Enable agent
    default-agent         # Set as default
    scan on               # Start scanning (wait 30 sec)
    devices               # List found devices
    pair XX:XX:XX:XX:XX   # Pair with device MAC
    connect XX:XX:XX:XX:XX # Connect to device
    trust XX:XX:XX:XX:XX  # Trust device for auto-connect
    exit                  # Exit bluetoothctl
                                         
💡 Pro Tip: If bluetoothctl shows "No default controller available", run:
sudo rmmod btusb then sudo modprobe btusb to reload Bluetooth drivers.
⚠️ Important: Some systems use different service management:
  • For SysV init: sudo service bluetooth restart
  • For systemd: sudo systemctl restart bluetooth
  • Check your init system: ps -p 1 -o comm=
Quick Fix Checklist:
  1. Install packages: sudo apt install bluez blueman
  2. Enable service: sudo systemctl enable --now bluetooth
  3. Check adapter: hciconfig -a
  4. Restart if needed: sudo systemctl restart bluetooth

6.5 Checking Network Using Terminal

The terminal provides powerful tools for diagnosing network issues. Here are essential commands:

Command What It Does Example
ping Test connection to a server ping google.com
ip addr Show network interfaces & IPs ip addr show
nslookup Check DNS resolution nslookup google.com
traceroute Trace network path to server traceroute google.com
ss or netstat Show active connections ss -tulpn
ip command replaces old ifconfig - learn it for modern systems.

6.6 Firewall Basics (UFW Explained)

UFW (Uncomplicated Firewall) is an easy-to-use firewall for Linux. It's a frontend for iptables that simplifies firewall management.

Basic UFW Commands:
sudo ufw enable                 # Turn on firewall
sudo ufw disable                # Turn off firewall
sudo ufw status                 # Check status
sudo ufw allow ssh              # Allow SSH (port 22)
sudo ufw allow 80/tcp           # Allow HTTP
sudo ufw deny from 192.168.1.10 # Block specific IP
Common Use Cases:
  • Allow web server: sudo ufw allow 80,443/tcp
  • Allow specific application: sudo ufw allow OpenSSH
  • Deny all incoming, allow all outgoing (default)
  • Rate limiting: sudo ufw limit ssh
⚠️ Don't enable UFW without allowing SSH first if you're connecting remotely!

6.7 VPN Usage & Privacy on Linux

Using a VPN on Linux is straightforward. Most VPN providers offer Linux apps, or you can use NetworkManager's built-in VPN support.

VPN Setup Methods:
  1. Official VPN apps: Many providers have .deb/.rpm packages
  2. NetworkManager integration: Import .ovpn files
  3. Command line: Use openvpn or wireguard tools
  4. Browser extensions: For browser-only VPN
Popular Linux VPN Clients:
  • OpenVPN: Standard protocol with GUI (network-manager-openvpn)
  • WireGuard: Modern, fast, simple configuration
  • NordVPN/ExpressVPN: Official Linux clients available
💡 WireGuard is built into Linux kernel 5.6+ for excellent performance.
Privacy Tips:
  • Use DNS over HTTPS in Firefox/Chrome
  • Consider using Tor Browser for maximum anonymity
  • Regularly check for DNS leaks: dnsleaktest.com
  • Disable unnecessary network services
✅ Linux + VPN = Excellent privacy combination with full control.

Essential Linux Commands – Complete Reference & Daily Usage

This module provides a comprehensive reference of essential Linux commands organized by category. Each command includes syntax, options, practical examples, and real-world use cases.

💡 How to use this module: Bookmark this page and return whenever you need to understand a specific command. Each section is self-contained with command details, common options, and beginner-friendly explanations.

⚠️ Important: Commands marked with ⚡ require sudo or root privileges. Always understand a command before running it, especially with sudo.

10.1 File System Navigation Commands

These commands help you move around and explore the Linux file system. Mastering navigation is the first step to terminal confidence.

📁 pwd – Print Working Directory

Purpose: Shows the full path of your current directory.

pwd # Output: /home/username/Documents

Real-world use: When you're lost in the terminal and need to know exactly where you are.

📋 ls – List Directory Contents

Purpose: Displays files and directories in the current location.

OptionDescriptionExample
ls -lLong format (permissions, size, date)ls -l /home
ls -aShow hidden files (starting with .)ls -la
ls -hHuman-readable sizesls -lh
ls -tSort by modification timels -lt
ls -RRecursive (show subdirectories)ls -R /etc
💡 Pro tip: ls -la is the most commonly used combination.

🔄 cd – Change Directory

Purpose: Move between directories.

cd /pathGo to specific directorycd /var/log
cd ~ or cdGo to home directorycd ~
cd ..Go up one levelcd ../.. (up two levels)
cd -Go to previous directorycd -

🌳 tree – Display Directory Structure

Purpose: Shows directories and files in a tree-like format.

tree tree -L 2 # Limit to 2 levels deep tree -a # Include hidden files

Install if missing: sudo apt install tree

📌 pushd / popd – Directory Stack

Purpose: Navigate between multiple directories efficiently.

pushd /var/log # Save current dir and move to /var/log pushd /etc # Save and move to /etc popd # Return to previous directory dirs # Show directory stack

10.2 File & Directory Management Commands

Create, copy, move, rename, and delete files and directories safely.

📄 touch – Create Empty File / Update Timestamp

touch file.txt # Create new empty file touch -t 202502111430 file.txt # Set specific timestamp touch file{1..5}.txt # Create file1.txt through file5.txt

📂 mkdir – Create Directories

mkdir newfolder mkdir -p parent/child/grandchild # Create nested directories mkdir dir_{1..3} # Create dir_1, dir_2, dir_3 mkdir -m 755 securedir # Create with specific permissions

🗑️ rm – Remove Files & Directories

⚠️ Warning: Deletion is permanent! No recycle bin in terminal.
CommandDescriptionExample
rm file.txtRemove single filerm old.txt
rm -r folderRemove directory and contentsrm -r downloads/
rm -f fileForce remove (no confirmation)rm -f log.txt
rm -rf /path⚠️ Dangerous: force recursive deleterm -rf temp/
rm -i *.txtInteractive (ask before each)rm -i *.log

📋 cp – Copy Files & Directories

cp source destCopy filecp file.txt backup.txt
cp -r dir1 dir2Copy directory recursivelycp -r /etc /etc-backup
cp -i file destInteractive (ask before overwrite)cp -i data.txt /backup/
cp -p file destPreserve permissions & timestampscp -p config.conf /etc/
cp -a source destArchive mode (preserve all attributes)cp -a /home/user /backup/

✂️ mv – Move / Rename

mv oldname.txt newname.txt # Rename file mv file.txt /path/to/destination/ # Move file mv -i source dest # Interactive (ask before overwrite) mv -u source dest # Update - move only when source is newer mv folder1 folder2 # Rename or move directory

🔗 ln – Create Links

Hard link vs Soft link (symlink):

ln file.txt hardlink.txt # Hard link (same inode) ln -s /original/file symlink # Soft/symbolic link (shortcut) ln -s /usr/bin/python3 python # Create alias for command
💡 Symlinks break if original file is moved; hard links don't.

10.3 File Viewing & Editing Commands

View file contents without opening full editors, or edit directly in terminal.

👁️ cat – Concatenate & Display

cat file.txt # Display entire file cat file1.txt file2.txt > combined.txt # Merge files cat > newfile.txt # Create file (Ctrl+D to save) cat -n code.py # Show with line numbers

📖 less / more – Page Through Files

less is more powerful than more (backwards navigation allowed).

less /var/log/syslog dmesg | less # Pipe output to less

Navigation: Space (next page), b (previous), g (top), G (bottom), / (search), q (quit)

🔍 head / tail – View Beginning/End of Files

head file.txtShow first 10 lineshead -n 20 file.txt (20 lines)
tail file.txtShow last 10 linestail -n 50 file.txt (50 lines)
tail -f logfile.logFollow mode (live updates)tail -f /var/log/syslog
tail -f -n 100 app.logFollow with initial 100 linesDebugging applications
Real-world use: tail -f is essential for watching log files in real-time.

📝 nano – Simple Terminal Text Editor

Best for beginners - intuitive and easy to use.

nano file.txt # Open file nano -l file.txt # Show line numbers nano -B file.txt # Create backup (.bak)

Shortcuts: Ctrl+O (save), Ctrl+X (exit), Ctrl+W (search), Ctrl+K (cut line)

⚡ vim – Advanced Text Editor

Powerful but has learning curve. Modes: Normal, Insert, Visual, Command.

vim file.txt # Open file vim +20 file.txt # Open at line 20 vimdiff file1.txt file2.txt # Compare files

Essential vim commands: i (insert), :w (save), :q (quit), :wq (save & quit), u (undo)

📊 stat – Display File Status

stat file.txt # Output includes: Size, Permissions, Access/Modify/Change timestamps, Inode

Useful for: Checking when file was actually modified vs changed permissions.

🔢 nl – Number Lines

nl script.sh # Show with line numbers nl -b a file.txt # Number all lines (including blank)

10.4 File Permissions & Ownership Commands

Control who can read, write, and execute files. Essential for security and multi-user systems.

📚 Permission Basics: r=4 (read), w=2 (write), x=1 (execute)
User(owner) | Group | Others → Example: 755 = rwxr-xr-x

🔐 chmod – Change File Permissions

Numeric mode (octal):

chmod 755 script.sh # rwxr-xr-x (owner: all, group/others: read/execute) chmod 644 file.txt # rw-r--r-- (owner: read/write, others: read only) chmod 600 private.key # rw------- (owner only, for SSH keys) chmod 777 file ⚠️ Dangerous: read/write/execute for everyone

Symbolic mode:

chmod u+x script.sh # Add execute for user chmod g-w file.txt # Remove write for group chmod o+r file.txt # Add read for others chmod a+x script.sh # Add execute for all (ugo) chmod -R 755 directory/ # Recursive change

👑 chown – Change File Owner

⚡ Requires sudo privileges.

sudo chown username file.txt # Change owner sudo chown username:groupname file.txt # Change owner and group sudo chown :groupname file.txt # Change only group sudo chown -R username:group directory/ # Recursive
💡 Example: sudo chown www-data:www-data /var/www/html - Set web server ownership

👥 chgrp – Change Group Ownership

sudo chgrp developers project/ # Change group to 'developers' sudo chgrp -R staff /shared/ # Recursive group change

🎭 umask – Set Default Permissions

Purpose: Determines default permissions for new files/directories.

umask # Show current umask (usually 0022) umask 077 # New files: 600, directories: 700 (private) umask 022 # New files: 644, directories: 755 (default)

Calculation: File permissions = 666 - umask, Directory = 777 - umask

🔒 chattr – Change File Attributes (Advanced)

⚡ Root privileges required. Sets immutable/append-only flags.

sudo chattr +i important.conf # Make file immutable (can't be deleted/modified) sudo chattr -i important.conf # Remove immutable flag sudo chattr +a logfile.log # Append-only mode lsattr file.txt # List attributes
⚠️ Even root cannot modify an immutable file until the flag is removed.

10.5 Process Management Commands

Monitor, control, and terminate running programs and processes.

📊 ps – Process Status

Purpose: Snapshot of current processes.

psProcesses in current shellps
ps auxAll processes (BSD syntax)ps aux | grep firefox
ps -efAll processes (standard syntax)ps -ef --forest (tree view)
ps -u usernameProcesses for specific userps -u www-data
ps -C commandProcesses by command nameps -C apache2

Common columns: PID (Process ID), %CPU, %MEM, VSZ, RSS, TTY, STAT, START, TIME, COMMAND

📈 top / htop – Interactive Process Viewer

top # Default process viewer htop # Enhanced, color-coded, easier to use top -u username # Show only user's processes top -p 1234,5678 # Monitor specific PIDs

top shortcuts: q (quit), k (kill process), u (filter by user), 1 (show CPU cores)

htop is better - install with sudo apt install htop

🛑 kill / pkill – Terminate Processes

SignalNumberPurposeExample
SIGTERM15Graceful termination (default)kill 1234
SIGKILL9Force kill (cannot be ignored)kill -9 1234
SIGHUP1Hangup (reload config)kill -1 1234
SIGSTOP19Pause processkill -19 1234
SIGCONT18Continue paused processkill -18 1234

pkill - kill by name:

pkill firefox # Kill all firefox processes pkill -f "python script.py" # Kill by full command line pkill -u username # Kill all processes of user
⚠️ Always try kill (SIGTERM) before kill -9 (SIGKILL).

⚖️ nice / renice – Process Priority

Priority range: -20 (highest) to 19 (lowest). Default: 0.

nice -n 10 ./backup-script.sh # Start with lower priority sudo renice -5 -p 1234 # Change priority of PID 1234 (higher) sudo renice +5 -u username # Lower priority for user's processes
💡 Use nice for CPU-intensive background tasks.

⬇️⬆️ bg / fg – Job Control

command & # Start process in background Ctrl+Z # Suspend foreground process bg # Resume suspended job in background fg # Bring background job to foreground jobs # List background jobs kill %1 # Kill job number 1

🔄 nohup – Run Immune to Hangups

Purpose: Continue running after terminal closes.

nohup long-script.sh & # Run in background, survives logout nohup python server.py > output.log 2>&1 & # With custom log file

Output goes to nohup.out by default.

🖥️ screen / tmux – Terminal Multiplexers

screen (pre-installed on most systems):

screen -S session_name # Start named session Ctrl+A, D # Detach from session screen -ls # List sessions screen -r session_name # Reattach to session

tmux (more modern): sudo apt install tmux

tmux new -s session_name Ctrl+B, D # Detach tmux attach -t session_name
✅ Essential for remote servers - your processes survive disconnection!

10.6 System Information Commands

Get details about your Linux system, kernel, hardware, and environment.

🖥️ uname – System Information

uname -a # All system information (kernel, hostname, arch) uname -r # Kernel release version uname -m # Machine hardware (x86_64, aarch64) uname -n # Network node hostname

Example output: Linux mypc 5.15.0-91-generic #101-Ubuntu SMP x86_64

🏷️ hostname – System Hostname

hostname # Show current hostname sudo hostname new-name # Temporarily change hostname hostname -I # Show IP addresses (capital i) hostnamectl # Detailed hostname info (systemd)

Permanent change: Edit /etc/hostname and /etc/hosts

⏰ uptime – System Running Time

uptime # 14:23:01 up 3 days, 2:15, 3 users, load average: 0.08, 0.12, 0.10

Shows: Current time, uptime, logged-in users, load averages (1, 5, 15 minutes)

👤 whoami / id – User Identity

whoami # Current username id # User ID, group ID, groups id username # Info about specific user groups # Show groups for current user

📅 date / cal – Date & Calendar

date # Current date/time date +"%Y-%m-%d %H:%M:%S" # Custom format sudo date -s "2025-02-11 15:30:00" # Set date (requires sudo) cal # Current month calendar cal 2025 # Full year calendar cal -3 # Previous, current, next month

🧮 bc – Command Line Calculator

echo "12 * 5" | bc # Basic arithmetic echo "scale=2; 10/3" | bc # Decimal precision bc -l # Start interactive mode with math library

📢 echo – Display Text

echo "Hello World" echo $HOME # Show variable value echo -e "Line1\nLine2" # Enable escape sequences echo -n "No newline" # Suppress trailing newline

🌍 env – Environment Variables

env # Show all environment variables export MYVAR="value" # Set environment variable unset MYVAR # Remove variable echo $PATH # Show executable search path
💡 Add to ~/.bashrc to make environment variables permanent.

🔄 which / whereis – Locate Commands

which python # Show path to executable which -a python # Show all matches in PATH whereis python # Show binary, source, man pages

10.7 User Management Commands

Create, modify, and delete users and groups. ⚡ All commands require sudo.

👤 useradd / adduser – Create Users

useradd (low-level):

sudo useradd username # Create user (basic) sudo useradd -m -s /bin/bash username # Create with home dir and shell sudo useradd -u 1500 -g groupname username # Specific UID and primary group

adduser (friendly, recommended):

sudo adduser username # Interactive, creates home, prompts for password

✏️ usermod – Modify Users

sudo usermod -aG sudo username # Add user to sudo group (Ubuntu) sudo usermod -aG docker username # Add to docker group sudo usermod -s /bin/zsh username # Change default shell sudo usermod -l newname oldname # Change username sudo usermod -L username # Lock user account sudo usermod -U username # Unlock user account
⚠️ Always use -aG (append) with groups, never -G alone (removes other groups).

🗑️ userdel – Delete Users

sudo userdel username # Remove user sudo userdel -r username # Remove user and home directory sudo userdel -f username # Force removal (even if logged in)

🔑 passwd – Change Passwords

passwd # Change own password sudo passwd username # Change another user's password sudo passwd -l username # Lock password (disable login) sudo passwd -u username # Unlock password sudo passwd -e username # Expire password (force change on next login)

👥 groupadd / groupdel – Manage Groups

sudo groupadd groupname # Create new group sudo groupdel groupname # Delete group sudo groupmod -n newname oldname # Rename group sudo gpasswd -d username groupname # Remove user from group

📋 who / w / last – Login Information

who # Who is logged in w # More detailed: what users are doing last # Login history (reads /var/log/wtmp) last -n 10 # Last 10 logins lastb # Failed login attempts

🔄 su – Switch User

su - username # Switch to user with their environment su - # Switch to root (requires root password) sudo su - # Switch to root using sudo (Ubuntu style)

10.8 Network Commands

Configure, monitor, and troubleshoot network connections.

🌐 ip – Modern Network Configuration

Replacement for deprecated ifconfig.

ip addr show # Show IP addresses ip link show # Show network interfaces ip route show # Show routing table sudo ip addr add 192.168.1.100/24 dev eth0 # Add IP address sudo ip link set eth0 up/down # Enable/disable interface

📶 ping – Test Connectivity

ping google.com # Ping until Ctrl+C ping -c 4 8.8.8.8 # Send 4 packets ping -i 2 -c 10 example.com # 2 second intervals ping -s 1472 example.com # Set packet size

Return codes: 0 (host reachable), 1 (unreachable), 2 (other error)

📊 netstat / ss – Network Statistics

ss is faster, modern replacement for netstat.

ss -tuln # Show listening ports (tcp, udp, listening, numeric) ss -tup # Show established connections with process netstat -i # Interface statistics netstat -r # Routing table
✅ Use ss -tuln | grep :80 to check if web server is running.

🔍 nslookup / dig – DNS Lookup

nslookup google.com # Basic DNS query dig google.com # Detailed DNS information dig -x 8.8.8.8 # Reverse lookup (IP to hostname) dig @8.8.8.8 example.com # Use specific DNS server dig MX gmail.com # Query mail exchange records

🛤️ traceroute – Network Path

traceroute google.com # Show path packets take mtr google.com # Combined traceroute + ping (real-time) tracepath example.com # Similar, no root needed

📡 wget / curl – Download Files

wget https://example.com/file.zip # Download file wget -c https://example.com/large.zip # Resume download wget -r -np -nH --cut-dirs=1 https://site.com/files/ # Recursive download curl -O https://example.com/file.zip # Download (save as filename) curl -o custom.zip https://example.com/file.zip # Download with custom name curl -I https://example.com # Fetch HTTP headers only

📱 nmcli – NetworkManager CLI

For systems with NetworkManager (most desktop distros).

nmcli dev status # Device status nmcli con show # Show connections nmcli con up/down id "Connection Name" # Connect/disconnect nmcli dev wifi list # Scan WiFi networks nmcli dev wifi connect SSID password PASSWORD # Connect to WiFi

10.9 Package Management Commands

Install, update, and remove software on Debian/Ubuntu systems.

⚠️ These commands vary by distribution. This section covers Debian/Ubuntu (apt).

📦 apt – Advanced Package Tool

Modern, user-friendly package manager.

CommandDescriptionExample
sudo apt updateUpdate package listsAlways run first
sudo apt upgradeUpgrade all packagessudo apt upgrade -y
sudo apt install packageInstall packagesudo apt install vim
sudo apt remove packageRemove packagesudo apt remove firefox
sudo apt purge packageRemove + config filessudo apt purge apache2
apt search keywordSearch packagesapt search pdf editor
apt show packageShow package detailsapt show python3
apt list --installedList installed packagesapt list --installed | grep python
sudo apt autoremoveRemove unused dependenciesClean up orphaned packages
sudo apt autocleanRemove old .deb filesFree disk space
💡 apt combines features from apt-get and apt-cache with better output.

🔧 dpkg – Debian Package Manager

Lower-level tool for working with .deb files.

sudo dpkg -i package.deb # Install local .deb file sudo dpkg -r package # Remove package dpkg -l # List installed packages dpkg -L package # List files installed by package dpkg -S /path/to/file # Find which package owns file sudo dpkg --configure -a # Fix interrupted installations

📱 snap / flatpak – Universal Packages

Sandboxed applications that work across distributions.

snap find searchterm # Search snaps sudo snap install package # Install snap snap list # List installed snaps sudo snap refresh package # Update snap flatpak search app # Search Flatpak flatpak install flathub app # Install Flatpak flatpak run app # Run Flatpak app

🔄 apt-get – Legacy Package Tool

Traditional command, still widely used in scripts.

sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade # Smart dependency resolution sudo apt-get install -f # Fix broken dependencies sudo apt-get clean # Clear package cache

10.10 Disk & Storage Commands

Monitor disk usage, partition drives, and manage filesystems.

💾 df – Disk Free Space

df -h # Human-readable sizes (GB, MB) df -T # Show filesystem type df -i # Inode usage (important for mail servers) df -h --total # Show total at end

Example output: /dev/sda1 100G 45G 55G 45% /

📊 du – Disk Usage

du -sh folder/ # Total size of directory du -h --max-depth=1 # Size of immediate subdirectories du -ah folder/ # Show size of each file du -sh * | sort -h # Sort by size (smallest to largest) du -sh * | sort -rh # Sort by size (largest first)
Find largest files: du -ah /home 2>/dev/null | sort -rh | head -20

💽 lsblk – List Block Devices

lsblk # Tree view of disks and partitions lsblk -f # Include filesystem info lsblk -m # Show permissions and owner lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,LABEL # Custom columns

🔧 fdisk / parted – Partition Tools

⚡ Require sudo and careful handling.

sudo fdisk -l # List all partitions sudo fdisk /dev/sdb # Interactive partition tool sudo parted -l # List partitions (more detailed) sudo parted /dev/sda print # Show partition table
⚠️ Partitioning can destroy data. Always backup and double-check device names.

🔌 mount / umount – Mount Filesystems

mount # Show all mounted filesystems sudo mount /dev/sdb1 /mnt/usb # Mount partition to directory sudo umount /mnt/usb # Unmount sudo mount -t ntfs /dev/sdb1 /mnt/usb # Specify filesystem type sudo mount -o ro /dev/sdb1 /mnt/usb # Mount read-only

🆔 blkid – Block Device Attributes

sudo blkid # Show UUID and filesystem type blkid -s UUID /dev/sda1 # Show only UUID

UUIDs are used in /etc/fstab for persistent mounting.

🩺 fsck – Filesystem Check

⚡ Filesystem must be unmounted.

sudo fsck /dev/sda1 # Check filesystem sudo fsck -f /dev/sda1 # Force check even if clean sudo fsck -y /dev/sda1 # Auto-repair (yes to all)

🔄 dd – Convert & Copy

Powerful low-level copying tool.

sudo dd if=/dev/sda of=/dev/sdb bs=4M status=progress # Clone disk sudo dd if=/dev/zero of=/tmp/test.img bs=1M count=100 # Create 100MB test file sudo dd if=/dev/sda of=backup.img bs=4M # Backup disk to image sudo dd if=backup.img of=/dev/sdb bs=4M # Restore from image
⚠️ dd is called "Disk Destroyer" for a reason. One wrong device and data is gone forever.

10.11 Compression & Archive Commands

Create and extract compressed archives.

📦 tar – Tape Archive

Most common archiving tool.

OperationCommandDescription
Createtar -czf archive.tar.gz folder/Create gzipped archive
Extracttar -xzf archive.tar.gzExtract gzipped archive
Createtar -cjf archive.tar.bz2 folder/Create bzip2 archive (smaller)
Extracttar -xjf archive.tar.bz2Extract bzip2 archive
Listtar -tf archive.tar.gzView contents without extracting
Extract specifictar -xzf archive.tar.gz file.txtExtract single file
Verbosetar -xzvf archive.tar.gzVerbose output (show files)

Options explained: c=create, x=extract, t=list, f=file, z=gzip, j=bzip2, v=verbose

🗜️ gzip / gunzip – GNU Zip

gzip file.txt # Compress (creates file.txt.gz) gunzip file.txt.gz # Decompress gzip -l file.txt.gz # List compression info zcat file.txt.gz # View compressed file

📚 zip / unzip – ZIP Archives

zip archive.zip file1.txt file2.txt # Create ZIP zip -r archive.zip folder/ # Recursive (include subfolders) zip -e secure.zip file.txt # Encrypt with password unzip archive.zip # Extract ZIP unzip -l archive.zip # List contents unzip archive.zip -d /target/folder # Extract to directory

10.12 Search & Text Processing Commands

Find files and manipulate text data.

🔎 grep – Global Regular Expression Print

Search text using patterns.

grep "error" logfile.log # Search for string grep -i "warning" logfile.log # Case-insensitive grep -r "TODO" ~/project/ # Recursive search grep -v "exclude" file.txt # Invert (lines NOT matching) grep -c "pattern" file.txt # Count matches grep -n "error" file.txt # Show line numbers grep -l "config" *.conf # List only filenames grep -A2 -B2 "error" log.txt # Show 2 lines after/before
💡 Common pipeline: history | grep "git" - Find git commands in history

🔍 find – Search for Files

find . -name "*.txt" # Find by name find / -type f -size +100M # Files larger than 100MB find ~ -type d -name "Documents" # Directories named Documents find . -mtime -7 # Modified in last 7 days find . -user username # Owned by specific user find . -name "*.tmp" -delete # Find and delete find . -name "*.py" -exec python {} \; # Execute command on each

⚡ locate – Fast File Search

locate filename # Search database (instant) sudo updatedb # Update database locate -i "document.pdf" # Case-insensitive

vs find: locate is faster but database may be outdated.

✂️ cut – Extract Columns

cut -d: -f1 /etc/passwd # Usernames (field 1, delimiter :) cut -c1-5 file.txt # First 5 characters each line cut -f2,3 -d',' data.csv # Columns 2 and 3 from CSV

📊 sort / uniq – Sort & Unique

sort file.txt # Sort alphabetically sort -n numbers.txt # Sort numerically sort -r file.txt # Reverse order sort -u file.txt # Sort and unique uniq file.txt # Remove adjacent duplicates sort file.txt | uniq -c # Count occurrences sort file.txt | uniq -d # Show only duplicates

📝 wc – Word Count

wc file.txt # Lines, words, bytes wc -l file.txt # Line count wc -w file.txt # Word count ps aux | wc -l # Count processes

🔄 sed – Stream Editor

Find and replace text.

sed 's/old/new/' file.txt # Replace first occurrence per line sed 's/old/new/g' file.txt # Replace all occurrences sed -i 's/old/new/g' file.txt # Edit file in-place sed '5d' file.txt # Delete line 5 sed '2,5d' file.txt # Delete lines 2-5 sed 's/ *$//' file.txt # Remove trailing spaces

10.13 SSH & Remote Access Commands

Securely connect to remote systems and transfer files.

🔐 ssh – Secure Shell

ssh user@hostname # Connect to remote ssh -p 2222 user@hostname # Custom port ssh -i ~/.ssh/id_rsa user@hostname # Use specific key ssh -J jumpuser@jumpbox user@target # Jump host (proxy) ssh -X user@hostname # Forward X11 (GUI apps) ssh -L 8080:localhost:80 user@hostname # Local port forwarding

🔑 ssh-keygen – Generate SSH Keys

ssh-keygen -t rsa -b 4096 # Generate RSA key (4096 bit) ssh-keygen -t ed25519 # Modern, more secure ssh-keygen -f ~/.ssh/customkey # Custom filename

📤 scp / rsync – File Transfer

scp file.txt user@host:/path/ # Copy to remote scp user@host:/path/file.txt . # Copy from remote scp -r folder/ user@host:/path/ # Copy directory rsync -avz source/ user@host:/dest/ # Sync with compression rsync -av --delete source/ dest/ # Mirror (delete extras) rsync --progress largefile user@host:/path/ # Show progress
rsync is better than scp for large transfers - it only transfers differences and can resume.

10.14 Date, Time & Scheduling Commands

Schedule tasks and manage system time.

⏰ crontab – Scheduled Tasks

Format: minute hour day month weekday command

crontab -e # Edit crontab crontab -l # List cron jobs crontab -r # Remove all jobs

Examples:

0 5 * * * /script.shDaily at 5:00 AM
*/15 * * * * /check.shEvery 15 minutes
0 0 * * 1 /weekly.shEvery Monday at midnight
@reboot /startup.shRun at system boot

⏱️ at – One-time Scheduled Task

at 14:30 # Schedule at specific time at now + 1 hour # One hour from now atq # List pending jobs atrm 5 # Remove job ID 5

👁️ watch – Execute Periodically

watch -n 2 df -h # Run df -h every 2 seconds watch -d free -h # Highlight differences watch 'ps aux | grep python' # Monitor Python processes

⏲️ timedatectl – System Time Control

timedatectl # Show current settings timedatectl list-timezones # List all timezones sudo timedatectl set-timezone America/New_York # Set timezone sudo timedatectl set-time "2025-02-11 14:30:00" # Set date/time sudo timedatectl set-ntp yes # Enable NTP sync

10.15 Hardware & Device Commands

View hardware information and manage devices.

🖥️ lspci – PCI Devices

lspci # List PCI devices lspci -v # Verbose lspci -nn # Show vendor/device IDs lspci | grep VGA # Graphics card lspci -s 00:02.0 -v # Specific device

🔌 lsusb – USB Devices

lsusb # List USB devices lsusb -v # Verbose lsusb -t # Tree view sudo lsusb -D /dev/bus/usb/001/002 # Device descriptor

🧠 lscpu – CPU Information

lscpu # CPU architecture, cores, threads cat /proc/cpuinfo # Detailed CPU info nproc # Number of processing units

Shows: Architecture, CPU op-modes, CPU(s), Thread(s) per core, Core(s) per socket, Model name, CPU MHz

💾 free – Memory Usage

free -h # Human-readable free -m # In MB free -s 2 # Repeat every 2 seconds vmstat 1 # Virtual memory stats

🧩 lsmod / modprobe – Kernel Modules

lsmod # List loaded modules sudo modprobe module_name # Load module sudo modprobe -r module_name # Remove module modinfo module_name # Show module info sudo depmod -a # Rebuild module dependencies

📟 dmesg – Kernel Ring Buffer

dmesg # All kernel messages dmesg | tail -20 # Recent messages dmesg -w # Follow (live) dmesg -l err,warn # Errors and warnings only

Useful for: Debugging hardware issues, USB device detection, driver problems.

🖥️ xrandr – Display Settings

xrandr # List displays and resolutions xrandr --output HDMI-1 --mode 1920x1080 # Set resolution xrandr --output eDP-1 --brightness 0.8 # Adjust brightness xrandr --output HDMI-1 --same-as eDP-1 # Mirror displays xrandr --output HDMI-1 --right-of eDP-1 # Extend displays

🎧 alsamixer – Sound Settings

alsamixer # Interactive sound mixer amixer set Master 70% # Set volume from terminal amixer set Master mute # Mute amixer set Master unmute # Unmute

🌡️ sensors – Temperature Monitoring

sensors # CPU/GPU temperatures sensors -f # Fahrenheit

Install: sudo apt install lm-sensors


📚 Quick Command Reference Card

Most commonly used commands for daily Linux usage:

Navigation:
pwd - Current location
ls -la - List all files
cd ~ - Go home
cd .. - Up one level
File Operations:
cp -r - Copy directory
mv - Move/rename
rm -r - Remove directory
mkdir -p - Create nested
Viewing:
cat - Display file
less - Page through
tail -f - Follow logs
head -n 20 - First 20 lines
Permissions:
chmod 755 - Executable
chmod 644 - Read/write
sudo - Admin rights
Processes:
ps aux - All processes
htop - Interactive
kill -9 PID - Force kill
Search:
grep -r - Search text
find . -name - Find files
locate - Fast search
⚠️ Safety Reminder

Commands to be extremely careful with:
rm -rf / - Deletes entire system
dd if=/dev/zero of=/dev/sda - Overwrites entire disk
chmod 777 / - Makes entire system world-writable
sudo without understanding what you're running

Module 10 Complete • Essential Linux Commands Reference • Bookmark this page for daily terminal work

Kali Linux Basics – Beginner & Safety Focused

This optional module introduces Kali Linux in a safe, ethical, and beginner-friendly way. You will understand what Kali Linux is, when to use it, how to run it safely using a USB pendrive, and how to avoid legal or beginner mistakes.

⚠️ This module focuses on learning, setup, and legal awareness. It does NOT teach hacking or illegal activities.


Kali Linux.1 What Is Kali Linux & Who Should Use It

Kali Linux is a Debian-based Linux distribution developed by Offensive Security. It is designed specifically for cybersecurity testing, ethical hacking, and digital forensics.

Unlike normal Linux systems (Ubuntu, Mint), Kali Linux comes pre-installed with hundreds of security-related tools. These tools are used to test systems you own or have permission to test.

🎯 Who Should Use Kali Linux?

  • Cybersecurity students
  • Ethical hackers (with permission)
  • Network administrators
  • Security researchers

🚫 Who Should NOT Use Kali Linux?

  • Normal daily computer users
  • Beginners without Linux knowledge
  • People looking for gaming or office work
💡 Important: Kali Linux is a learning and testing OS, not a replacement for Windows or Ubuntu.

Kali Linux.2 Is Kali Linux Legal? Important Rules

Kali Linux itself is 100% legal to download, install, and use. However, how you use it determines legality.

⚖️ Legal Usage

  • Practicing on your own computer
  • Learning Linux commands
  • Testing your own Wi-Fi or server
  • Lab platforms (TryHackMe, Hack The Box)

🚨 Illegal Usage

  • Hacking websites without permission
  • Attacking public Wi-Fi networks
  • Breaking into accounts or systems
⚠️ Unauthorized hacking is a crime in most countries and can lead to jail time, fines, and permanent records.
✅ Learn Kali Linux ethically and legally — skills matter more than shortcuts.

Kali Linux.3 Ways to Use Kali Linux (USB, Install, VM)

Kali Linux can be used in multiple ways depending on your experience and system setup.

Method Description Best For
Live USB Run Kali from pendrive without installing Beginners & safe testing
Full Installation Install Kali on hard disk Advanced users
Virtual Machine Run Kali inside VirtualBox Students & labs
💡 Recommended for beginners: Live USB or Virtual Machine

Kali Linux.4 Create Kali Linux Bootable Pendrive

A bootable pendrive allows you to run Kali Linux without installing it.

🧰 Requirements

  • USB drive (minimum 16GB)
  • Kali Linux ISO (official)
  • Rufus / BalenaEtcher

⬇️ Download Kali Linux (Official ISO Files)

Kali Linux provides different download formats depending on how you want to use it. Always download Kali Linux from official sources only.

1️⃣ Kali Linux Live USB (No Installation)

This version runs directly from a pendrive without installing Kali Linux. Note: The Live ISO is officially distributed via torrent only.

⚠️ Kali Linux Live ISO does not have a direct browser download link. Torrent is the official and recommended method.
2️⃣ Kali Linux Full Installation (Direct ISO)

This ISO can be downloaded directly in a browser and used to install Kali Linux or boot from USB.

💡 This installer ISO works perfectly for USB boot and learning Kali Linux.
3️⃣ Kali Linux Virtual Machine (Easiest & Safest)

Pre-built Kali Linux virtual machines are available for VirtualBox and VMware. No ISO or USB is required.

✅ Recommended for beginners: Virtual Machine or Installer ISO USB
4️⃣ Download Kali Linux ISO (Direct Link for USB)

To create a Kali Linux bootable pendrive, you need the official Kali Linux Installer ISO. This file can be downloaded directly in your browser without using torrent.

💡 This ISO works perfectly for:
  • Bootable USB (Rufus / BalenaEtcher)
  • Fresh Kali Linux installation
  • Learning & practice

⚙️ Steps (Using Rufus)

  1. Insert USB drive
  2. Open Rufus
  3. Select Kali ISO
  4. Partition scheme: GPT (UEFI)
  5. Click Start
⚠️ All data on the USB will be erased.
✅ You now have a Kali Linux bootable pendrive.

Kali Linux.5 Boot Kali Linux & First-Time Setup

After creating the bootable USB, you can boot Kali Linux safely.

🚀 Boot Steps

  1. Restart PC
  2. Press Boot Menu key (F12 / Esc / F9)
  3. Select USB device
  4. Choose Live System

🔧 First-Time Setup

  • Set keyboard layout
  • Connect Wi-Fi
  • Update system (optional)
💡 Default username: kali | password: kali
✅ Kali Linux is now ready for learning and labs.