Build knowledge of the Linux File System, study and execute the following Linux and Windows Shell Commands such as mkdir, pwd, ls, cp, cd, mv, rm, rmdir, touch, free, and System Related Commands
Aim / Objective
To understand the Linux Filesystem Hierarchy Standard (FHS), contrast it with Windows drive letters, and study, execute, and master fundamental command-line shell utilities: `mkdir`, `pwd`, `ls`, `cp`, `cd`, `mv`, `rm`, `rmdir`, `touch`, `free`, and system diagnostic commands in Linux and Windows.
Hardware & Software Requirements
Hardware Components
- PC running Ubuntu/Debian Linux (native installation, dual-boot, or VirtualBox VM), or Windows 10/11 with WSL2 (Windows Subsystem for Linux)
- Keyboard and Display
Software, OS & Tools
- Linux Bash Shell (`/bin/bash`) or Zsh
- Windows Command Prompt (`cmd.exe`) and PowerShell 7
Teacher's Lab Delivery Guide
Essential briefing notes, pedagogy, and setup tips for lab instructors⏱ 5-Minute Pre-Lab Lecture Briefing:
Contrast the Windows world (`C:\`, `D:\`, drive letters, backslashes, case-insensitive) with the Linux world (single unified inverted tree starting at root `/`, forward slashes, strictly case-sensitive, everything is a file). Explain that in Linux, terminal skills are not an optional extra—they are the primary superpower of system administrators and cloud engineers.
📝 Key Concepts to Write on Whiteboard:
- Linux Filesystem Hierarchy Standard (FHS): `/` (root), `/bin` (user binaries), `/etc` (system configuration), `/home` (user home directories), `/var` (variable logs/spools), `/dev` (device files), `/proc` (kernel virtual filesystem)
- Absolute paths (starts with `/`) vs Relative paths (starts with current directory, `./` or `../`)
- The "Everything is a File" philosophy (hardware devices, processes, sockets are treated as file streams)
- Standard directory commands: `pwd`, `cd`, `mkdir -p`, `rmdir`, `ls -la`
- File manipulation commands: `touch`, `cp -r`, `mv`, `rm -rf`, `cat`, `head`, `tail`
- System diagnostic commands: `free -m` (memory), `df -h` (disk usage), `uname -a` (kernel), `top`/`htop` (processes), `uptime`
Step-by-Step Practical Procedure
Inspect Linux Filesystem Hierarchy & Current Working Directory
Launch terminal. Print the current working directory. List the top-level root directory contents with permissions and hidden files.
pwd && ls -la /
Create Directory Trees with `mkdir` & Navigate with `cd`
Create a nested directory structure in one command using the `-p` (parents) flag. Navigate into the directory and then return to home using relative and absolute paths.
mkdir -p ~/cse_lab/module1/practical10 && cd ~/cse_lab/module1/practical10
Create Empty Files with `touch` and Write Content
Create new empty files using `touch`. Write sample text to a file using redirection (`>`) and append (`>>`). Display contents using `cat`.
touch notes.txt config.cfg && echo "Hardware Lab 2026" > notes.txt && cat notes.txt
Copy (`cp`) and Move / Rename (`mv`) Files & Directories
Copy `notes.txt` to a backup file. Rename `config.cfg` to `settings.conf` using `mv`. Copy the entire directory recursively with `cp -r`.
cp notes.txt notes_backup.txt && mv config.cfg settings.conf
Delete Files (`rm`) and Directories (`rmdir` / `rm -r`)
Remove the backup file. Use `rmdir` on an empty folder. Attempt `rmdir` on a non-empty folder (it fails), then use `rm -r` for recursive removal.
rm notes_backup.txt && rm -r ~/cse_lab/module1
Execute System Diagnostic Commands (`free`, `df`, `uname`, `top`)
Check physical and swap memory in megabytes using `free -m`. Check disk filesystem utilization in human-readable gigabytes (`df -h`). Display kernel and OS details (`uname -a`).
free -m && df -h && uname -a
Interactive Hands-On Lab Simulator
Practice and test concepts virtually before or after performing on physical lab equipmentObservations & Student Lab Record
Students are required to record the following measured parameters, hardware specifications, and output status into their physical lab journals:
| Linux Command | Function / Purpose | Key Options / Switches | Windows Equivalent Command |
|---|---|---|---|
| `pwd` | Print Working Directory (shows absolute path) | None | `cd` (without arguments) / `Get-Location` |
| `ls` | List directory contents | `-l` (long format), `-a` (all/hidden), `-h` (human sizes) | `dir` / `Get-ChildItem` |
| `cd` | Change directory | `..` (parent), `~` (home), `-` (previous directory) | `cd` / `chdir` |
| `mkdir` | Make directory | `-p` (create parent directories without error) | `mkdir` / `md` |
| `touch` | Create empty file or update timestamp | `-a` (access time only) | `type nul > file.txt` / `New-Item` |
| `cp` | Copy files and directories | `-r` (recursive), `-v` (verbose), `-i` (interactive prompt) | `copy` / `xcopy` / `robocopy` |
| `mv` | Move or rename files and directories | `-f` (force), `-n` (do not overwrite) | `move` / `ren` |
| `rm` | Remove files or directories | `-r` (recursive), `-f` (force without prompt) | `del` / `rmdir /s` / `Remove-Item` |
| `rmdir` | Remove empty directory | `-p` (remove empty parents) | `rd` / `rmdir` |
| `free` | Display total, used, and free RAM and Swap | `-m` (Megabytes), `-g` (Gigabytes), `-h` (Human) | `systeminfo | findstr Memory` |
| `uname` | Display OS and kernel release information | `-a` (all details), `-r` (kernel release) | `winver` / `systeminfo` |
Conclusions & Learning Outcome
The Linux Filesystem Hierarchy Standard was thoroughly analyzed. Hands-on execution of directory management (`pwd`, `cd`, `mkdir`, `rmdir`), file operations (`touch`, `cp`, `mv`, `rm`), and system telemetry commands (`free -m`, `df -h`, `uname -a`) demonstrated proficiency in command-line administration, reinforcing parity with Windows equivalents.
Oral Exam & Viva Questions with Answers
Essential questions asked by external examiners and lab evaluators (Accordion UI)In Linux, all files, directories, mounted storage partitions, and devices branch under a single unified root directory symbolized by `/`. In contrast, Windows assigns independent drive letters (`C:`, `D:`, `E:`) to separate storage partitions.