JB logo
CoffeeyOUTUBE
Blog
PreviousNext

Complete Linux Training: A Full Study Guide

Linux from the ground up — what an operating system actually is, the history and anatomy of Linux, then the daily-driver skills: files, directories, paths, permissions, links and command syntax. A structured reference to keep beside your terminal while you learn.

🐧 Complete Linux Training Course — Full Study Guide

A polished, structured companion guide built from the full course transcript — Imran Afzal's Complete Linux Training Course to Get Your Dream IT Job. Use this as your reference while following along in your own lab.


📚 Table of Contents

  1. Course Overview & How It's Organized
  2. Everyday Examples of Linux
  3. What Is an Operating System?
  4. What Is Linux?
  5. History of Linux
  6. Unix vs Linux
  7. Popular Linux Distributions ("Flavors")
  8. Who Uses Linux?
  9. Linux vs Windows
  10. Building Your Lab
  11. Installing Linux (CentOS 7 / 8 / 9, Red Hat, Ubuntu)
  12. Installing on the Cloud (AWS)
  13. Snapshots
  14. Virtual Machine Management
  15. Keyboard Keys Used in Linux
  16. Important Things to Remember About Linux
  17. Accessing Your Linux System (Console vs Remote / SSH / PuTTY)
  18. Command Prompts & Getting "Unstuck" (Ctrl+C)
  19. Understanding "root" (3 Meanings)
  20. Changing Passwords
  21. The Linux File System
  22. File System Structure — Directory by Directory
  23. Navigating the File System (cd, pwd, ls)
  24. File & Directory Properties (ls -l)
  25. Absolute Path vs Relative Path
  26. Creating Files & Directories
  27. Copying Directories
  28. Finding Files: find vs locate
  29. Wildcards
  30. Linux File Types
  31. Soft Links vs Hard Links
  32. Command Syntax: Command + Option + Argument
  33. Quick-Reference Command Cheat Sheet

1. Course Overview & How It's Organized

The course is broken into 10 modules, each ending with quizzes, homework, and handouts:

ModuleTopic
1Understanding Linux concepts (Unix vs Linux)
2Download, install & configure a Linux machine (VM setup, CentOS/Red Hat install)
3System access & file system (command prompt, putty, cd/pwd/ls, touch, wildcards, links)
4Linux fundamentals — command syntax, chmod, ACLs, tab-completion, pipes, filters
5System administration — vi/sed, user accounts, sudo, LDAP/AD, system utilities
6Shell scripting — if, for, while loops
7Networking, servers & system updates — bonding, ports, SSH/Telnet, DNS, NTP, sendmail
8Disk management — run levels, partitions, LVM, RAID, NFS
9Resume workshop
10Interview prep, certification path, 200+ interview questions

Plus a final course recap, a 100-question final exam, and 20+ bonus lectures.

💡 This guide focuses on Modules 1–4 (the conceptual foundation + file system + basic commands), matching the transcript provided.


2. Everyday Examples of Linux

Linux is running all around you, even when you don't realize it:

  • ✈️ Airplanes — in-flight entertainment systems run on embedded Linux
  • 📶 Wi-Fi routers — embedded Linux powers the web management interface
  • 📺 Smart TVs, Google, search websites, smartphones, tablets, e-readers
  • 💽 Windows data-recovery discs — ironically run Linux to repair Windows
  • 🏠 Touchscreen appliances
  • 🚗 Self-driving cars — extensive testing software running on Linux

3. What Is an Operating System?

Wikipedia's definition: An operating system is system software that manages computer hardware and software resources and provides common services for computer programs.

In plain English: An OS (Operating System) is software that acts as a middleman / bridge between the computer hardware and the user (you). It gives you an interface and controls the hardware so other software can function.

              +-------------------+
              |   USER (You)      |
              +-------------------+
                        |
                        v
      +---------------------------------------+
      |          OPERATING SYSTEM              |
      |   Middleman / Bridge — manages          |
      |   hardware & provides services          |
      +---------------------------------------+
                        |
                        v
      +---------------------------------------+
      |          COMPUTER HARDWARE              |
      +---------------------------------------+
 
  Example: you click "print" -> OS tells the
  printer hardware what to do

Types of Operating Systems

TypeExamples
Desktop OSWindows, macOS, Linux (Ubuntu)
Server OSWindows Server, Linux (CentOS, Red Hat)
Mobile OSAndroid, iOS, Windows Mobile
Embedded OSRouters, smart TVs, automobiles, home appliances
Real-Time OS (RTOS)Medical equipment, car ECUs, aerospace, defense, firewalls, home security

4. What Is Linux?

Linux is a free and open-source operating system.

  • Free → download, install, and run it without paying (some distros charge for support, e.g., Red Hat)
  • Open source → the source code is public; anyone can view/modify it for their needs

Installing an OS onto a "blank brick" computer

  1. Power on a computer with no OS — it's just hardware
  2. Attach an ISO image (modern equivalent of inserting a CD/DVD)
  3. Run the installation wizard
  4. Configure settings → "Welcome to Linux"
  5. Now you can send commands via keyboard/mouse and the OS relays them to hardware (printer, browser, etc.)

Why Learn Linux?

  • ✅ Widely used in servers & cloud computing (most of the corporate world)
  • Free and open-source philosophy
  • ✅ Strong command-line interface (CLI) — most Linux servers have no GUI
  • ✅ Faster processing, enhanced security
  • ✅ Fully customizable
  • ✅ Large community support
  • ✅ Understanding Linux helps you understand other OSes
  • Career opportunities 🚀

5. History of Linux

1970                1983              1991                1994          2007
 |                    |                 |                   |             |
 v                    v                 v                   v             v
Unix born      GNU Project        Linux kernel         v1.0 released   Android
AT&T Bell Labs Richard Stallman   Linus Torvalds, 21    176,000 lines   Google,
(Thompson &    Free tools,        "Just a hobby..."     of code        Linux-based,
 Ritchie)      no kernel yet                                           mobile boom
 
  Kernel (0.01) -> Kernel + GNU tools = "Linux" -> grew via internet
  collaboration into distros
YearEvent
1970Unix developed at AT&T Bell Labs by Ken Thompson & Dennis Ritchie. Revolutionary, but not freely available (proprietary versions).
1983Richard Stallman launches the GNU Project ("GNU's Not Unix") — free tools & utilities, but no kernel.
1991Linus Torvalds, a 21-year-old Finnish student, starts building a free OS kernel as a hobby. On Aug 25, 1991 he posts on the Minix newsgroup: "I'm doing a free operating system... just a hobby, won't be big and professional like GNU."
Sept 1991Kernel v0.01 released — not functional, released for public feedback.
Late 1991v0.02 released — functional, combined with GNU tools = a complete free OS. This combo became known simply as "Linux" (some argue it should be called GNU/Linux).
Early 1990sRapid growth via internet collaboration → distros like Slackware, Debian emerge.
1994v1.0 released — 176,000 lines of code.
Late 1990sRed Hat and SUSE offer commercial support → viable for business.
2000Big adoption in server markets, embedded systems, supercomputers.
2007Google releases Android (Linux-based) → huge boost in mobile.
TodayPowers mobile devices, PCs, servers, mainframes, and supercomputers.

6. Unix vs Linux

UnixLinux
OriginMid-1970s, Bell Labs (AT&T, GE, MIT)1991, Linus Torvalds — inspired by Unix but written from scratch
LicenseMostly free to use/modify/distribute under GPLOpen source
CostFree to download; some flavors (Red Hat) charge for supportSame — most free, some (Red Hat) charge for subscription/support
Main vendorSun (Solaris) — acquired by Oracle in 2010; also HP-UX, AIXRed Hat, CentOS, Debian, Fedora, SUSE, Ubuntu
File systemsSupports fewer file systemsSupports many more file systems
HardwareRuns on limited/specific hardware (like macOS on Apple hardware)Runs on almost any AMD/Intel hardware — phones to supercomputers

DistroNotes
UbuntuMost popular for beginners; based on Debian; backed by Canonical
FedoraSponsored by Red Hat; cutting-edge features; has Workstation/Server/Silverblue variants
DebianCommunity-driven, very stable; the foundation for Ubuntu
Red Hat Enterprise Linux (RHEL)Backed by Red Hat; built for business; used by ~70–80% of corporate environments
CentOS / CentOS StreamFree, open-source clone of RHEL; direction changed after CentOS 8 (see box below)
Arch LinuxRolling release; build-your-own-system philosophy; simplified version = Manjaro
openSUSETumbleweed (rolling) & Leap (regular release); sponsored by SUSE
Linux MintBased on Ubuntu; traditional desktop feel, built-in media tools
GentooSource-based; users compile from source; highly customizable
SlackwareOne of the oldest distros; minimalist
Alpine LinuxLightweight, security-focused; popular for containers
Kali LinuxBuilt for digital forensics & penetration testing

🎯 Recommendation from the course: If your goal is a corporate Linux job, learn CentOS — it's the free replica of Red Hat Enterprise Linux, which dominates the corporate world.

📦 CentOS vs CentOS Stream — Quick History

  • 2004 — Greg Kurtzer took Red Hat's open-source code, rebranded it → CentOS
  • 2014 — Red Hat acquired the CentOS project
  • Before Feb 2021: Fedora → RHEL → CentOS (CentOS = downstream copy)
  • After Feb 2021: Fedora → CentOS Stream → RHEL (CentOS Stream is now upstream, i.e., testing ground before RHEL)
  • Verdict: Still absolutely worth learning — as of this course, CentOS 9 Stream is the latest version.

8. Who Uses Linux?

User GroupExamples
DevelopersWide language/tooling support
Educational institutionsCS research & teaching
Government agencies (US)DoD, NSA, FAA, NASA, FBI
EnterprisesWalmart, Boeing, McDonald's, Bank of America, NYSE, GM, Pfizer
Tech companiesGoogle, Facebook, Amazon, Microsoft, Oracle, Intel, IBM
Cloud/Web serversUbuntu Server, CentOS, RHEL dominate the web server market
Supercomputing/researchComplex computational tasks
Telecom/networkingAT&T, Nokia, Vodafone, T-Mobile
Media & entertainmentPixar, DreamWorks, Sony Pictures, Netflix

9. Linux vs Windows

CategoryLinuxWindows
Source codeOpen — free to read, study, modify, redistributeProprietary (Microsoft) — closed
CostFree (support/subscription may cost extra, e.g. Red Hat)Paid (bundled into the price of a new PC)
User interfaceMultiple DEs (GNOME, KDE, XFCE); servers usually have NO GUIOne standard GUI across versions
CLICore to Linux — very powerful terminal & scriptingCMD/PowerShell exist but rarely used by average users
Package managementapt, yum, pacman — handles dependencies automatically.exe installers / Microsoft Store — manual dependency handling
SecurityGenerally more secure (permission system, fewer users targeted)Larger attack surface (larger user base); improved via Windows Defender
Stability/performanceCan run for months/years without rebootSlows over time (registry bloat, background processes)
File systemsext4, XFS, BTRFS — treats everything as a file; hierarchical from /NTFS, FAT32 — uses drive letters (C:\)

10. Building Your Lab

There are two options to set up your practice environment:

+--------------------------------------------------------------+
|   Your Laptop / Desktop (Windows or Mac) -- the "Host"        |
|                                                                |
|   +--------------------------------------------------------+ |
|   |  Virtualization Software (Oracle VirtualBox/VMware)     | |
|   |                                                          | |
|   |   +--------------------------------------------------+  | |
|   |   |  Virtual Machine                                  |  | |
|   |   |  Guest OS: CentOS / Red Hat / Ubuntu               |  | |
|   |   |  RAM: 2GB . Disk: 20GB . Bridged Network           |  | |
|   |   |                                                    |  | |
|   |   |  [iuser@my-linux-vm ~]$ _                          |  | |
|   |   +--------------------------------------------------+  | |
|   +--------------------------------------------------------+ |
+--------------------------------------------------------------+
 
  The host OS is never touched -- the guest Linux OS runs
  safely on top.
  1. Have a Windows or Mac computer
  2. Install virtualization software:
    • Oracle VirtualBox (free, open-source, used in this course)virtualbox.org
    • VMware Workstation Player (free for non-commercial use)
  3. Create a Virtual Machine (VM) on top of it
  4. Install Linux inside the VM — your host OS is untouched

Option 2 — Cloud Platform (AWS / Google Cloud)

  1. Create a free-tier account on AWS, Google Cloud, etc.
  2. Launch a virtual machine instance with a Linux AMI pre-built
  3. Requires a credit card (be careful of usage limits — e.g., AWS free tier gives ~750 hours/month compute and 30 GB storage; exceeding it = charges)

What Is Oracle VirtualBox?

A free, open-source hypervisor for x86 computers (developed by Oracle). It installs on top of your existing OS (Windows/Mac/Linux/Solaris) and lets you run multiple operating systems on the same hardware simultaneously.

Installing VirtualBox

  1. Browse to www.virtualbox.orgDownloads
  2. Pick the package for your host OS (e.g., Windows hosts)
  3. Run the installer → accept defaults → click through the network-interface reset warning → Install
  4. Launch VirtualBox once finished

Installing VMware Workstation Player (optional alternative)

  1. Search "download VMware Workstation Player"
  2. Download the Windows installer, run it, accept defaults
  3. Choose "free for non-commercial use"

Creating a New Virtual Machine (VirtualBox)

SettingRecommended Value
NameMy Linux VM (auto-detects type = Linux)
VersionLinux 2.6 / 3.x / 4.x / 5.x (64-bit)
RAM2048 MB (2 GB)
CPU1 (can increase later)
Hard Disk20 GB, dynamically allocated, VDI
NetworkSettings → Network → change NAT → Bridged Adapter (so the VM gets a real IP and internet access)

⚠️ Important: Always switch the network adapter to Bridged Adapter before installing — this lets the VM auto-detect your Wi-Fi/LAN and get online during setup.


11. Installing Linux

Three Ways to Install Any OS

  1. CD/DVD — insert physical media, boot from it
  2. ISO Image — download the image, attach it as a virtual disc via your server's console (Dell iDRAC, HP iLO, or a VM's virtual media) (method used in this course)
  3. Network Boot (PXE) — common in large orgs installing hundreds of machines from a shared NFS/Samba server

💡 About 80% of the corporate world runs Red Hat Enterprise Linux, and CentOS is functionally identical to RHEL, but free. That's why the course installs CentOS (versions 7, 8, or 9 Stream — pick any; ~90% of commands transfer to other distros).

Step-by-Step: Installing CentOS (7 / 8 / 9) in VirtualBox

  1. Download the ISO

    • Search download CentOS <version> → go to centos.org → pick x86_64 → choose the mirror with the largest file (the full "everything" ISO, ~9–10 GB)
  2. Create the VM in VirtualBox (see Section 10 settings above) and set network to Bridged Adapter

  3. Attach the ISO: Start the VM → click the folder icon → Add → browse to your downloaded .isoChooseStart

  4. Boot menu: use arrow keys (mouse won't work yet) → select "Install CentOS" → Enter

    • Tip: Right-Ctrl key releases a mouse trapped inside the VM window
  5. Installation Wizard (GUI):

    ScreenWhat to Do
    WelcomeChoose language (e.g., English/United States) → Continue
    Date & TimeAuto-detected to your region
    Keyboard / Language SupportAuto-detected
    Installation SourceLocal media (already selected since ISO is attached)
    Software Selection"Server with GUI" (gives you a desktop, not just CLI)
    Installation DestinationSelect the disk (e.g., 20 GB) → Done
    KDUMPLeave enabled (captures kernel crash logs)
    Network & Host NameSet a host name (e.g., my-linux-vm) → Apply → toggle Ethernet ONDone
    Security PolicyLeave default
    Root PasswordSet a password for the root admin account (weak password warning is OK for a lab — click Done twice to confirm)
    User CreationCreate a regular user (your name); optionally check "Make this user administrator"
  6. Click Begin Installation → installs ~300+ packages (5–30 min depending on system speed)

  7. Reboot → Accept license → Finish configuration

  8. Log in as your regular user (or click "Not listed" to log in as root)

  9. Right-click desktop → Open Terminal 🎉 — installation complete!

The install flow for CentOS 7, 8, 9 Stream, and Red Hat Enterprise Linux is nearly identical — the only visible difference is the logo, and whether you need a Red Hat subscription account to download the RHEL ISO.

Installing Ubuntu (Optional)

  1. Create a new VM (type auto-detects as "Ubuntu" once you type the name); RAM 2GB+, 2 CPUs, 25 GB disk
  2. Download the Ubuntu Desktop ISO (search "download Ubuntu")
  3. Attach ISO → Start → choose "Install Ubuntu"
  4. Keyboard layout → Normal installation (skip "download updates while installing" for speed)
  5. "Erase disk and install Ubuntu" — this only erases the VM's virtual disk, not your real computer
  6. Set timezone, create username/hostname/password
  7. Wait for install → Restart Now → log in
  8. Right-click desktop → Open Terminal

~80–85% of commands used on CentOS/Red Hat also work on Ubuntu.


12. Installing on the Cloud (AWS)

  1. Go to AWS Free Tier sign-up (requires a credit card)
  2. Once in, navigate to EC2 (Elastic Compute Cloud) dashboard
  3. Pick the region closest to you
  4. Launch Instance → name it → search AMIs for Red Hat (CentOS isn't directly listed; RHEL is essentially the same)
  5. Instance type: t2.micro (free-tier eligible = 1 CPU, 1 GB RAM)
  6. Create/select a key pair (.pem file — needed to connect via PuTTY/SSH later)
  7. Firewall: Allow SSH traffic from anywhere (or restrict as needed)
  8. Storage: up to 30 GB free-tier eligible — going over incurs charges
  9. Launch Instance

⚠️ Cost warning: Free tier gives 750 compute-hours/month and 30 GB storage total. Running multiple instances or exceeding storage limits will charge your card — monitor usage carefully.


13. Snapshots

A snapshot saves the current state of your VM so you can restore it later if something breaks — without reinstalling the whole OS.

How to Take a Snapshot (VirtualBox)

  1. Make sure the VM is Powered Off
  2. In VirtualBox Manager, select your VM → click Take (snapshot)
  3. Give it a name (e.g., first-install-snapshot) → OK

How to Restore

  1. Select the snapshot → click Restore
  2. The VM returns exactly to that saved state

💡 Take a snapshot right after your first successful install — if you break something a few weeks into the course, you can roll back instantly instead of reinstalling from scratch.


14. Virtual Machine Management

Roughly 80% of corporate compute environments run on virtualized platforms, so knowing how to adjust VM resources is a real job skill.

Common settings you can change (VM must usually be powered off, unless "hot add" is supported)

Setting TabWhat You Can Change
GeneralVM name, snapshot folder location, shared clipboard/drag-and-drop, description, encryption
SystemRAM (base memory), boot order, # of CPUs/processors, hardware acceleration
DisplayVideo memory (affects resolution options), remote display
StorageAttach/detach virtual disks, see allocated vs. actual disk size
AudioHost audio driver
NetworkAdapter type — NAT, Bridged, Host-only, Internal; add more adapters
USBPass through physical USB devices
Shared FoldersShare a host folder with the guest VM

Real-world scenario: A user says "my server needs more RAM/CPU/disk." On physical hardware, this means opening the case, buying/installing new components (sometimes impossible if slots are full). On a virtual machine, you just adjust the setting — often on the fly ("hot add").


15. Keyboard Keys Used in Linux

Knowing the names of these symbol keys will help you understand instructions and pronounce commands correctly:

KeySymbolUsed For
EscEscape / exit editing mode (e.g., in vi)
Tilde~Shortcut for your home directory (cd ~)
Backtick`Command substitution
Bang / Exclamation!History expansion, negation
At sign@Email addresses, user@host
Pound / Hashtag#Comments in scripts/config files; also the root prompt symbol
Dollar sign$Variables in scripts; also the regular user prompt symbol
Carrot / Caret^"Starts with" in pattern matching
Ampersand&Run a process in the background (command &)
Asterisk / Star*Wildcard — matches anything
Parentheses( )Grouping
Hyphen / Dash-Command options (e.g., ls -l)
Curly braces{ }Brace expansion (e.g., file{1..9}.txt)
Bracket[ ]Character range wildcard
EnterAlso called carriage return
Colon : / Semicolon ;Used in vi (:wq!) and to chain commands
Quotes " 'String quoting
Pipe|Sends output of one command into the next — heavily used!
Backslash\Windows path separator (not used for paths in Linux)
Less-than / Greater-than< >Input/output redirection (> overwrite, >> append)
Question mark?Wildcard — matches a single character
Forward slash/Linux path separator
Right CtrlReleases a captured mouse in VirtualBox

16. Important Things to Remember About Linux

  • 🔐 root is the super-user account — it can create, modify, or delete anything, including the entire OS. Be careful!
  • 🔠 Linux is case-sensitiveABCabc as file/directory names
  • 🚫 Avoid spaces in file/directory names — use hyphens or underscores instead
  • 🧩 The kernel is not the OS — it's a small piece of software inside Linux that passes commands from users to hardware
  • ⌨️ Linux is mostly CLI (Command Line Interface), not GUI
  • 🧘 Linux is flexible — steeper learning curve early on, but far more powerful long-term

17. Accessing Your Linux System

There are two ways to access a Linux machine:

A) Console Access

Direct access via a monitor/keyboard cable (VGA/HDMI/DVI) — or, for a VM, the hypervisor's built-in console window.

B) Remote Access

Connecting over the network — the most common method in corporate environments.

FromTool Needed
Windows 10+Built-in ssh client in Command Prompt — no extra software needed
Windows (older)PuTTY client
MacBuilt-in ssh in Terminal
Linux → LinuxBuilt-in ssh

Finding Your Linux Machine's IP Address

ifconfig
# or, on newer CentOS/RHEL (if ifconfig isn't installed):
ip addr

If ifconfig isn't available on CentOS 7.5+/RHEL, install it as root:

yum install net-tools

Connecting via PuTTY (Windows)

  1. Download PuTTY → search "download putty" → get the 64-bit .msi → install with defaults
  2. Open PuTTY → enter the Linux machine's IP addressOpen
  3. Accept the host-key warning → log in with your Linux username/password

Connecting via native SSH (Windows 10+, Mac, or Linux)

ssh <username>@<ip-address>
# example:
ssh iafzal@10.253.1.22
 
# or using the -l (login) flag:
ssh -l <username> <ip-address>

18. Command Prompts & Getting "Unstuck"

A command prompt (or just "prompt") is the short text at the start of a command line, ending in a prompt symbol:

[root@my-first-linux-vm ~]#
PartMeaning
rootThe logged-in username
my-first-linux-vmThe hostname
#Prompt symbol — you're logged in as root
$Prompt symbol — you're logged in as a regular user

Handy identity commands

who am i      # shows your logged-in username
hostname      # shows the machine's hostname

🔓 Stuck? Get your prompt back with Ctrl + C

If a command hangs (e.g., you typed cat with no filename and hit Enter, or top is still running, or a pipe | is left open), press:

Ctrl + C

This cancels the current command and returns your prompt.


19. Understanding "root" (3 Meanings)

A huge source of confusion for beginners — Linux uses the word "root" for three different things:

#TermWhat It Means
1root accountThe super-user username — most powerful account on the system (like Windows "Administrator")
2root directory/ — the very first / top-level directory in the file system
3root's home directory/root — the home folder belonging to the root user

⚠️ Don't confuse these! "Go to the root directory" means cd /. "Go to root's home directory" means cd /root. "Log in as root" means switching your user account, not navigating anywhere.


20. Changing Passwords

# Change YOUR OWN password (works for any logged-in user):
passwd
 
# As root, change a SPECIFIC user's password:
passwd <username>
# example:
passwd iafzal

Flow when you run passwd:

  1. Prompts for your current/old password
  2. Prompts for a new password
  3. Prompts to retype the new password (to confirm no typos)

💡 Note the command is passwdno "o" or "r" — it's p-a-s-s-w-d.

If your password is too short or matches a dictionary word, Linux will warn "password fails the dictionary check" — for a lab this is fine, just confirm by pressing through; in production, always pick a strong password.


21. The Linux File System

Definition: A file system is how the OS organizes and manages files/directories, controlling how data is saved and retrieved from disk.

Analogy — a closet: 👔 Shirts on one shelf, pants on another, shoes in their own section. Without organization, everything gets thrown into one messy pile and you can't find anything. A file system keeps your OS's "closet" organized: config files in one folder, user files in another, logs in another, etc.

Common File Systems

LinuxWindows
ext3, ext4, XFS, BTRFSNTFS, FAT32

Key structural difference:

  • Windows — uses drive letters (C:\) and stores program files, user profiles, and OS config in separate top-level folders on that drive.
  • Linux — has one single hierarchical tree, starting at / (the root). Everything — including hardware devices — is represented as a file somewhere in that tree.
cd /
ls -l

22. File System Structure — Directory by Directory

                                /
                                |
   +----------+----------+-----------+----------+----------+----------+
   |          |          |           |          |          |          |
 /boot      /root       /etc       /home       /var       /opt
bootloader  root user's config    regular    logs        3rd-party/
files       home dir   files      users'     (/var/log)  add-on apps
(grub.cfg)             (system-   home dirs
                        wide)
 
   +----------+----------+-----------+----------+----------+----------+
   |          |          |           |          |          |          |
/bin,/sbin  /lib        /tmp        /dev       /proc      /media
everyday+   shared      temporary   device     running    CD/DVD
system      library     scratch     files      process    mount
commands    files       files       (disks,    info (RAM  point
                                     keyboard)  only)
 
  Windows analogy: "/" is like C:\  -- everything hangs off one
  root, no drive letters.
 
  Note: /root != /  (don't confuse the root user's home folder
  with the root of the filesystem)
 
  Tip: a directory listing (ls -l) shows a "d" at the very start
  of the line for folders.
DirectoryPurpose
/bootBootloader files (e.g., grub.cfg) — used every time the system boots to decide which kernel/OS version to start
/rootThe root user's home directory (⚠️ not the same as /)
/devDevice files — disks, CD-ROM, speakers, flash drives, keyboards, etc. — every peripheral shows up as a file here
/etcSystem-wide configuration files (DNS, sendmail, NTP, etc.) — always back up before editing!
/bin (→ /usr/bin)Everyday user commands (ls, pwd, etc.)
/sbin (→ /usr/bin)System/administration commands (disk & filesystem tools)
/optThird-party / add-on applications (e.g., Oracle, SAP) — not for built-in OS apps
/procVirtual files for all running processes — exists only in RAM; empty after shutdown
/lib (→ /usr/lib)Shared C/C++ library files needed by commands and applications
/tmpTemporary scratch files — no long-term significance
/homeHome directories for regular users (e.g., /home/iafzal)
/varVariable data, most importantly /var/log — where system & application logs live (first place to check when troubleshooting!)
/runEarly-boot system daemon runtime files (PIDs, etc.) — temporary, cleared on reboot
/mntMount point for external file systems (e.g., NFS shares)
/mediaWhere CD-ROM/removable media get auto-mounted

Exploring it yourself

cd /
ls -ltr
cd /boot/grub2
ls -ltr
cd /etc
ls -ltr

23. Navigating the File System

Three essential commands — you cannot do anything in Linux without them:

CommandStands ForPurpose
cdChange DirectoryMove into a different directory
pwdPrint Working DirectoryTells you where you currently are
lsListLists contents of a directory

🖱️ Windows analogy: Double-clicking a folder icon in Windows Explorer secretly does three things at once — it changes into that directory (cd), lists its contents (ls), and shows you where you are in the address bar (pwd). In Linux, you run all three manually.

Core navigation commands

pwd                 # Where am I?
cd /                # Go to the root directory
ls -l               # List contents with details
cd boot             # Go into the "boot" subdirectory (relative path)
cd ..                # Go UP one directory
cd                  # No argument = go straight to YOUR home directory
cd ~                # Same as above (tilde = home directory)
cd -                # Go to the PREVIOUS directory you were in

Example walk-through:

cd /            # go to root
pwd             # /            <- confirms location
cd etc          # relative move into /etc
cd sysconfig    # relative move into /etc/sysconfig
pwd             # /etc/sysconfig
cd ..           # back up one level -> /etc
cd ..           # back up again -> /

24. File & Directory Properties (ls -l)

Just like right-clicking a file in Windows → Properties shows you size, type, dates, and permissions, Linux shows this via:

ls -l

Sample output breakdown:

drwxr-xr-x  2 root root  4096 Jan 10 09:15 Documents
-rw-r--r--  1 root root   512 Jan 10 09:20 notes.txt
ColumnMeaning
1st character (d, -, l...)File typed = directory, - = regular file, l = link
Remaining 9 charsPermissions (owner / group / other)
Number (e.g., 2)Number of hard links
1st name (e.g., root)Owner of the file
2nd name (e.g., root)Group that owns the file
Number (e.g., 4096)Size in bytes
Date/timeWhen it was created/modified
Last fieldName of the file or directory
ls -l           # alphabetical listing with details
ls -ltr         # sorted by time, oldest first, newest at the BOTTOM (very useful!)

💡 If you cd into something and get "Not a directory" — check with ls -l: if there's no d at the start of that line, it's a file, not a folder, and you can't cd into it.


25. Absolute Path vs Relative Path

  ABSOLUTE PATH                      RELATIVE PATH
  ---------------------------        ---------------------------
  always starts with /               never starts with /
 
    $ cd /var/log/samba                $ cd log
                                        $ cd samba
 
  Works from ANYWHERE -- you          Depends on WHERE you
  don't need to already be in a       currently are (pwd) --
  particular folder.                  shorter, but position-based.
 
  Full route from the root "/"        Relative to your current
                                       directory
TypeStarts With /?Works From
Absolute path✅ YesAnywhere — full route from /
Relative path❌ NoOnly relative to your current directory
# ABSOLUTE — works no matter where you currently are:
cd /var/log/samba
 
# RELATIVE — only works if you're already inside /var:
cd log
cd samba

⌨️ Pro tip: Press Tab while typing a path to auto-complete the directory/file name if it exists.


26. Creating Files & Directories

There are 4 ways to create a file, and 1 primary way to create a directory.

Method 1 — touch (creates an empty file)

touch jerry
touch kramer
touch bart lisa marge     # create MULTIPLE files in one command

Method 2 — cp (copy an existing file to a new name/location)

cp jerry lex
cp jerry clark

Method 3 — vi / vim editor (creates a file with actual content)

vi homer
# inside the editor, to save & quit:
:wq!

Method 4 — Redirection (bonus, seen throughout the transcript)

echo "Hulk is a superhero" > hulk.txt

Creating directories with mkdir

mkdir seinfeld
mkdir superman simpsons     # create multiple directories at once

Verifying what you created

ls -ltr

🔒 Permissions matter! If you try to create a file in a directory you don't own (e.g., /etc as a regular user), you'll get "Permission denied" — only root (or the file/directory owner) can write there.

touch /etc/test123
# -bash: /etc/test123: Permission denied

27. Copying Directories

Copying a directory (not just a file) requires the -r (recursive) option — otherwise cp will complain that the source is a directory.

# WRONG - will fail with "omitting directory":
cp config /tmp/config-backup
 
# CORRECT - recursive copy:
cp -r config /tmp/config-backup

-r tells cp to copy the folder plus every subfolder and file inside it.

# Full example:
mkdir config
cd config
touch a.conf b.conf c.conf
cd ..
cp -r config /tmp/config-backup
ls -ltr /tmp/config-backup     # confirms all 3 files copied over

28. Finding Files: find vs locate

findlocate
How it worksSearches the live file system in real timeSearches a pre-built database
SpeedSlower (walks the actual disk)Much faster
AccuracyAlways accurate (live)Can be stale if the database isn't updated
Needs root?Often yes (to see into every directory)No, but the DB update (updatedb) needs root

Using find

# search starting at current directory (.) for a file named "Kramer":
find . -name "Kramer"
 
# search the ENTIRE system starting from root:
find / -name "enp0s3.nmconnection"

You'll often need to su - to root first — otherwise you'll get a wall of Permission denied errors for directories you can't read.

Using locate

locate Kramer

If locate returns nothing (because the file is new and the database hasn't caught up), refresh the database as root:

su -
updatedb

Check/install the required package (mlocate) if locate isn't available:

rpm -qa | grep mlocate       # check if it's installed
dnf install mlocate           # install it if missing (as root)

💡 Interview tip: If asked "where's this config file located?" it's perfectly fine to say "I'd run find or locate to check" — you don't need to memorize every file path.


29. Wildcards

Wildcards let a single character (or symbol) stand in for a range of possible matches — like a wild card in poker.

WildcardMatches
* (asterisk / star)Zero or more characters
? (question mark)Exactly one character
[ ] (brackets)Any one character from the specified range/set
{ } (curly braces)Brace expansion — generate a sequence

Examples

# Create 9 files at once using brace expansion:
touch abcd{1..9}-xyz
# creates: abcd1-xyz, abcd2-xyz, ... abcd9-xyz
 
# List every file starting with "abc":
ls -l abc*
 
# Delete every file starting with "abc":
rm abc*
 
# Delete every file ENDING in "xyz":
rm *xyz
 
# Match ANY single first character, followed by "bcd" + anything:
ls -l ?bcd*
 
# Match any file containing "A" OR "B" in the name:
ls -l [AB]*
 
# Delete any file that has "XY" together in the name:
rm *XY*

⚠️ Wildcards work with any commandls, rm, cp, etc. Always double-check with ls before running rm with a wildcard — deletions are permanent!


30. Linux File Types

Every file in Linux has a type, identified by the first character in an ls -l listing:

SymbolFile TypeDescription
(none/dash -)Regular fileText files, executables, images, videos — most common type
dDirectoryCalled a "folder" in Windows
lLinkPoints to another file/directory (soft or hard link)
cCharacter device fileRepresents hardware like keyboards, serial ports
bBlock device fileRepresents hardware like hard drives, USB drives (data handled in blocks)
sSocket fileUsed for network communication between processes
pNamed pipe (FIFO)Used for inter-process communication, first-in-first-out
ls -l
# d rwxr-xr-x ...   <- directory
# - rw-r--r-- ...   <- regular file
# l rwxrwxrwx ...   <- link

📋 Interview tip: Managers often ask "what does a file starting with c represent?" — know this table by heart.


First, understand the inode: every file on disk is tracked by the OS using a number called an inode — the name (e.g., hulk) is just a human-friendly label; the OS actually tracks the file by its inode number.

  SOFT LINK (ln -s)                  HARD LINK (ln)
  -------------------                -------------------
   [ link file ]                      [ hulk (file) ]   [ link file ]
        |                                    \                /
        | (points to name)                    \              /
        v                                       v            v
   [ hulk (file) ]                          [   SAME inode (data)  ]
        |
        | (points to data)
        v
   [ inode (data) ]
 
  If "hulk" is deleted,               If "hulk" is deleted,
  the link BREAKS (x)                 the link STILL WORKS (v)
Soft Link (Symbolic Link)Hard Link
Commandln -s <source> <link-name>ln <source> <link-name>
Points toThe file name/pathThe same inode directly
If source is deletedLink breaks ❌ (dangling link)Link still works ✅ (data persists)
AnalogyA Windows shortcutAn identical twin sharing the same data

Commands

# Create a source file:
touch hulk
echo "Hulk is a superhero" > hulk
 
# --- SOFT LINK ---
cd /tmp
ln -s /home/iafzal/hulk hulk        # create the soft link
ls -ltr                              # notice the "l" type + arrow (hulk -> /home/iafzal/hulk)
cat hulk                             # reads through to the source content
 
# Delete the SOURCE file:
cd /home/iafzal
rm hulk
cd /tmp
cat hulk                             # "No such file or directory" -- soft link is now BROKEN
 
# --- HARD LINK ---
cd /home/iafzal
touch hulk
echo "Hulk is a superhero" > hulk
cd /tmp
ln /home/iafzal/hulk hulk            # create the hard link (no -s !)
cat hulk                             # same content
 
# Delete the SOURCE file again:
cd /home/iafzal
rm hulk
cd /tmp
cat hulk                             # STILL WORKS -- hard link kept the data alive!

Checking inode numbers

ls -li     # the "i" option shows the inode number as the first column

A soft link gets its own, different inode number (it's a separate pointer file). A hard link shares the exact same inode number as the original file.


32. Command Syntax: Command + Option + Argument

command  [options]  [argument]
   ls       -ltr        Bart
PartPurpose
CommandThe action to perform (e.g., ls)
OptionModifies how the command behaves — usually - + a letter (can be grouped: -ltr = -l -t -r)
ArgumentWhat to act on — a specific file/directory name

Examples

ls                 # command only -> basic listing
ls -l              # + option -> detailed listing
ls -ltr            # + grouped options -> detailed, sorted by time, reversed (oldest first)
ls -l Bart         # + argument -> details for ONE specific file
 
rm -f somefile     # force-remove a file, no confirmation prompt
rm -r seinfeld     # remove a DIRECTORY (requires -r, recursive)

📖 Always check the manual for available options

man ls
# Press SPACE to scroll down, Q to quit

33. Quick-Reference Command Cheat Sheet

Identity & System Info

who am i           # who am I logged in as?
hostname           # what's this machine's name?
pwd                # print working directory
cd /path           # absolute path
cd relative/path   # relative path
cd ..              # up one level
cd ~  |  cd        # go home
cd -               # go to previous directory
ls / ls -l / ls -ltr

Files & Directories

touch file1 file2       # create empty file(s)
cp source dest           # copy a file
cp -r sourcedir destdir  # copy a DIRECTORY (recursive)
mkdir dirname            # create a directory
mkdir dir1 dir2           # create multiple directories
rm file                  # delete a file
rm -r dirname             # delete a directory (recursive)
rm -f file                # force delete, no prompt
mv source dest             # move/rename
vi filename                # edit/create a file (:wq! to save & quit)

Searching

find . -name "filename"
find / -name "filename"
locate filename
updatedb                  # refresh locate's database (as root)

Wildcards

*        # zero or more characters
?        # exactly one character
[AB]     # one char from a set
{1..9}   # brace expansion / sequence
ln -s source linkname     # soft (symbolic) link
ln source linkname        # hard link
ls -li                    # show inode numbers

Passwords & Root

passwd                    # change your own password
passwd username            # (as root) change another user's password
su -                       # switch to root
who am i

Remote Access

ifconfig       # or: ip addr   -> find your IP
ssh user@ip
ssh -l user ip

Getting Unstuck

Ctrl + C     # cancel a hung/stuck command and get your prompt back

🎯 What's Next?

This guide covers the conceptual foundation + file system + core commands (Modules 1–4). The course continues into:

  • Module 4 (cont.)chmod permissions, ACLs, pipes, filters
  • Module 5vi/sed, user/group management, sudo, LDAP/Active Directory
  • Module 6 — Shell scripting (if, for, while)
  • Module 7 — Networking, SSH/Telnet, DNS, NTP, sendmail
  • Module 8 — Disk management, LVM, RAID, NFS
  • Modules 9–10 — Resume workshop & interview preparation

📝 Homework from the instructor: Log into your Linux VM, run cd / then ls -l, and manually explore every top-level directory — go in, list its contents, come back out — until navigating the file system feels natural.


Guide compiled from the full course transcript — "Complete Linux Training Course to Get Your Dream IT Job" by Imran Afzal.