This lab helps you understand how Linux works internally, not just type commands.
By the end of these labs, Linux will feel logical, not intimidating.
Before You Start The Lab (Very Important).
What You Need
You can use any Linux environment:
-
Ubuntu Desktop / Server
-
Linux VM
-
Cloud VM
-
WSL (Windows Subsystem for Linux)
No special distro required. Linux concepts are universal.
Core Rule Before We Begin
In Linux, everything is a file, everything is text, and everything is discoverable.
Keep this in mind throughout the labs.
LAB 1: Understanding Where You Are (Navigation Basics)
Step 1: Check Your Current Location
pwd
Definition:
pwd = Print Working Directory
It tells you:
-
Where you are in the filesystem
-
Which directory commands will act on
📌 Linux always knows where you are, just like a GPS.
Step 2: List Files and Directories
ls
Definition
ls = List directory contents
Linux does not show files automatically like Windows Explorer. You must ask explicitly.
Step 3: View Hidden Files
ls -a
Explanation
Files starting with “.” are hidden configuration files.
Linux hides configs by default to reduce clutter.
Examples:
-
.bashrc -
.profile -
.ssh
Key Understanding
Your home directory is your personal workspace, not the whole system.
LAB 2: Linux Filesystem Hierarchy (CRITICAL LAB)
Step 1: List the Root Directory
ls /
You’ll see directories like:
bin etc home var usr tmp dev proc
What These Mean (Memorize the Purpose, Not the Names)
| Directory | What It Really Does |
|---|---|
/ |
Root of everything |
/bin |
Essential commands (ls, cp, mv) |
/sbin |
System admin commands |
/etc |
Configuration files |
/home |
User personal folders |
/var |
Logs & changing data |
/tmp |
Temporary files |
/usr |
Applications & libraries |
/dev |
Hardware as files |
/proc |
Kernel & process info |
Step 2: Explore Configuration Files
ls /etc
📌 You’ll notice:
-
Plain text files
-
No binaries
-
Human-readable configs
👉 Linux is configured by editing text, not clicking GUIs.
Step 3: View Logs
ls /var/log
Logs answer:
-
What happened?
-
When?
-
Why something failed?
This is where real troubleshooting starts.
Key Understanding
If you know
/etcand/var/log, you can debug most Linux systems.
LAB 3: Understanding the Terminal & Shell
Step 1: Identify Your Shell
echo $SHELL
Definition
A shell is a program that:
-
Reads commands
-
Interprets them
-
Sends them to the kernel
Common shells:
-
bash
-
zsh
-
sh
Step 2: Understand the Prompt
Example:
user@server:/home/user$
| Part | Meaning |
|---|---|
| user | Logged-in user |
| server | Hostname |
| /home/user | Current directory |
$ |
Normal user |
# |
Root (admin) |
📌 Never ignore the prompt; it tells you your power level.
Key Understanding
Linux is multi-user by design. Knowing who you are matters.
LAB 4: How Linux Finds Commands
Step 1: Locate a Command
which ls
Explanation
Linux searches directories listed in $PATH.
Step 2: View PATH
echo $PATH
You’ll see directories like:
/usr/bin:/bin:/usr/sbin
Linux:
-
Reads command
-
Searches PATH left → right
-
Executes first match
Key Understanding
If it’s not in
$PATH, Linux can’t run it by name.
LAB 5: Linux Help Systems (THIS MAKES YOU INDEPENDENT)
Step 1: Use the Manual
man ls
What You Would be Seeing
-
NAME → What the command does
-
SYNOPSIS → How to use it
-
DESCRIPTION → Detailed behavior
-
OPTIONS → Flags & switches
📌 Man pages are official documentation.
Step 2: Quick Help
ls --help
This gives:
-
Short descriptions
-
Common options
-
Faster lookup
Step 3: Info Pages
info coreutils
Structured, long-form documentation.
Key Understanding
Linux experts don’t memorize commands; they know how to read documentation fast.
LAB 6: Files Are Text (Viewing Safely)
Step 1: View a File Safely
cat /etc/os-release
This shows:
-
OS name
-
Version
-
Distro details
Step 2: Use a Pager (Recommended)
less /etc/passwd
Why less?
-
Scroll up/down
-
Doesn’t flood terminal
-
Safe for large files
Key Understanding
Config files explain your system better than tutorials.
LAB 7: Navigation Mastery
cd /
cd /etc
cd /var/log
cd ~
cd ..
Definitions
-
cd→ change directory -
~→ home directory -
..→ parent directory
📌 You should be able to move without thinking.
LAB 8: Understanding File Types (Linux Is Not Windows)
This lab teaches you how Linux identifies file types without relying on extensions.
Step 1: Identify File Types
ls -l
What You’re Seeing
The first character in each line tells you the file type:
| Symbol | Meaning |
|---|---|
- |
Regular file |
d |
Directory |
l |
Symbolic link |
c |
Character device |
b |
Block device |
s |
Socket |
p |
Named pipe |
Why This Matters
Linux does not rely on .exe, .txt, .jpg extensions. It reads metadata instead.
Step 2: Use the file Command
file /bin/ls
The file command inspects the file’s magic number – a signature inside the file – to determine its type.
Examples you might see:
- ELF 64-bit executable
- ASCII text
- Shell script
- JPEG image data
Key Understanding
Linux determines file type by content, not name. This is why renaming a file doesn’t change what it is.
LAB 9: Understanding Absolute vs Relative Paths
Navigation becomes effortless once you understand how Linux resolves paths.
Step 1: Absolute Path
cd /etc
Meaning
Starts from / (root). Always the same, no matter where you are.
Step 2: Relative Path
cd ../var/log
Meaning
Starts from your current directory. .. = parent . = current directory
Step 3: Combine Both
cd /etc/../var/log
Linux resolves this to:
/var/log
Key Understanding
Linux resolves paths before executing commands. This is why scripts can use relative paths safely.
LAB 10: Creating, Copying, Moving, and Deleting Files
(The Safe Way)
Beginners often fear breaking things. This lab teaches safe file manipulation.
Step 1: Create Files
touch notes.txt
Explanation
touch updates timestamps, but if the file doesn’t exist, it creates it.
Step 2: Create Directories
mkdir projects
mkdir -p projects/app1/logs
-p creates parent directories automatically.
Step 3: Copy Files
cp notes.txt notes-backup.txt
What the command does
This command copies the file notes.txt and creates a new file called notes-backup.txt.
Nothing is deleted or moved, it’s a straight duplication.
Recursive Copy
cp -r projects projects-backup
What the command does
This command copies an entire directory named “projects” including all files and subfolders inside it, and creates a new directory called projects-backup.
Nothing is moved or deleted. It’s a full recursive copy.
Step 4: Move/Rename Files
mv notes.txt archive.txt
What the command does
This command renames the file notes.txt to archive.txt.
Nothing is copied. Nothing is duplicated. The original file name simply changes.
Linux uses the same command for moving and renaming.
Step 5: Delete Files Safely
rm archive.txt
Delete Directories
rm -r projects-backup
Safer Delete (Prompt Before Removing)
rm -i archive.txt
Key Understanding
Linux does not have a recycle bin. Deletion is permanent unless you use safety flags.
LAB 11: Wildcards & Pattern Matching (Powerful Skill)
Wildcards let you operate on multiple files at once.
Step 1: Match All Files
ls *
Step 2: Match Files Starting With “a”
ls a*
Step 3: Match Files Ending With “.log”
ls *.log
Step 4: Match Single Characters
ls file?.txt
Matches:
- file1.txt
- fileA.txt
Not matched:
- file10.txt
Step 5: Match Ranges
ls file[1-5].txt
Key Understanding
Wildcards are handled by the shell, not the command. The shell expands patterns before running the command.
LAB 12: Redirection & Pipes (The Heart of Linux Power)
Linux commands are small tools. Pipes let you chain them into powerful workflows.
Step 1: Redirect Output to a File
ls /etc > etc-list.txt
> overwrites the file.
Step 2: Append Output
ls /var >> etc-list.txt
>> appends instead of overwriting.
Step 3: Redirect Errors
ls /root 2> errors.txt
2> captures error messages.
Step 4: Pipe Output to Another Command
ls /etc | grep ssh
Explanation
| sends output of one command into another.
Step 5: Count Lines
ls /etc | wc -l
Key Understanding
Pipes turn Linux into a modular system where small tools combine into powerful workflows.
LAB 13: Searching Files & Directories (Find Anything)
Searching is a core Linux skill.
Step 1: Search for Files by Name
find /etc -name "*.conf"
Step 2: Search by Type
find /var -type d
-type d = directories -type f = files
Step 3: Search Inside Files
grep "root" /etc/passwd
What the command does
This command searches for the word “root” inside the /etc/passwd file and prints any lines that contain it.
/etc/passwd is the file that stores all user accounts on the system.
Step 4: Recursive Search
grep -R "sshd" /etc
Step 5: Case-Insensitive Search
grep -i "ubuntu" /etc/os-release
What the command does
This command searches every file and subdirectory inside /etc for any lines that contain the text “sshd”.
It performs a recursive search, meaning it goes through:
/etc- All folders inside
/etc - All files inside those folders
…and prints any matches.
Key Understanding
find locates files. grep searches inside files. Together, they are your Linux search engine.
LAB 14: Understanding Processes
(Linux Is Always Running Something)
Processes are programs in motion.
Step 1: View Running Processes
ps aux
What You See
- USER
- PID (process ID)
- CPU usage
- Memory usage
- Command
Step 2: Real-Time Process Viewer
top
Or the improved version:
htop
Step 3: Kill a Process
kill <PID>
Force kill:
kill -9 <PID>
Step 4: Find a Process by Name
pgrep ssh
Step 5: See Process Tree
pstree
Key Understanding
Linux is a living system. Processes are the heartbeat.
LAB 15: Environment Variables (The Hidden Settings of Linux)
Environment variables control how Linux behaves.
Step 1: View All Variables
printenv
Step 2: View a Specific Variable
echo $HOME
echo $USER
echo $PATH
Step 3: Create a Temporary Variable
export GREETING="Hello Linux"
echo $GREETING
Step 4: Make It Permanent
Add to ~/.bashrc:
export GREETING="Hello Linux"
Reload:
source ~/.bashrc
Key Understanding
Environment variables shape your shell, your tools, and your scripts.
If You Completed These Labs…
You now understand:
- What Linux actually is
- How the filesystem is structured
- How the shell works
- How commands are found
- How to self-learn using
man - Where configs and logs live
- How Linux identifies files
- How paths work
- How to manipulate files safely
- How wildcards expand
- How pipes create workflows
- How to search anything
- How processes behave
- How environment variables shape your system
This is real Linux foundation, not surface learning.
This is real Linux literacy, not memorized commands.
“If you completed these labs, you’re no longer a Linux beginner, you’re Linux-aware. That’s the difference.”
Next Step Mastering Linux Core Operations: Users, Permissions, sudo, Packages & Services (Beginner → Intermediate)
-
Users & groups (UID/GID)
-
Permissions & ownership
-
sudo & root access
-
Package management
-
Services & systemd



