Peters School of Business · Assiniboine College · NETW-0001
2 hours · Lab 2 Parts 1–2 · Shell basics, filesystem hierarchy, navigation, directories
Verify desktop2 and collect research answers
/var typically used for? What makes ext4 the standard choice for Linux partitions? What were the AI tool examples of Linux in the real world?The terminal, TTY, the Linux filesystem hierarchy, and paths
Part 1 — Terminal vs. shell, and why bother (8 min)
Part 2 — The Linux filesystem hierarchy (12 min)
/. Everything — drives, USB sticks, network shares, even running processes — appears somewhere under /. Additional storage is "mounted" as a subdirectory, not given a new letter.| Directory | Purpose | Windows equivalent |
|---|---|---|
/ | The root — top of the entire filesystem tree | C:\ (roughly) |
/bin | Essential user binaries — ls, cp, mv, cat, grep. Must be available even in single-user mode | C:\Windows\System32 (partly) |
/sbin | System binaries for admin tasks — fdisk, ifconfig, mount. Root-only tools | Elevated system utilities |
/home | User home directories — /home/student, /home/alice, etc. Personal files live here | C:\Users\ |
/root | Home directory of the root user — separate from /home for security | C:\Users\Administrator |
/etc | Configuration files — editable text files that control system and application behaviour | Registry (conceptually) |
/var | Variable data — logs, mail, package manager data, print spool. Changes constantly | C:\Windows\Logs + C:\ProgramData |
/tmp | Temporary files — cleared on reboot. World-writable | C:\Windows\Temp |
/usr | User-installed programs and their support files — most applications live here | C:\Program Files |
/opt | Optional/third-party software that doesn't follow standard layout | C:\Program Files (non-standard installs) |
/dev | Device files — every hardware device appears as a file here. /dev/sda = first disk | No direct equivalent |
/proc | Virtual filesystem — shows running processes and kernel info as files. Not on disk | Task Manager data, roughly |
/lib | Shared libraries required by /bin and /sbin — like .dll files | C:\Windows\System32 .dll files |
/media | Mount point for removable media — USB drives, DVDs auto-mount here | D:\ (removable drives) |
Part 3 — Absolute vs. relative paths (10 min)
/ — specifies the complete location from the root of the filesystem. It is always the same, regardless of where you currently are. Example: /home/student/lab2/notes.txt — this path works from anywhere on the system./ — specifies a location relative to your current directory. Example: if you are currently in /home/student, then lab2/notes.txt refers to the same file. If you move to /etc, the same relative path lab2/notes.txt now points to /etc/lab2/notes.txt — which probably doesn't exist.~ — your home directory (/home/student). cd ~ always takes you home.
. — the current directory. ./script.sh means "run script.sh in the current directory."
.. — the parent directory. cd .. goes up one level.
- — the previous directory. cd - toggles between the last two locations.
C:\Users\Student is absolute, .\Documents is relative.Lab 2 — The Terminal: TTY, navigation, and directory operations
All lab work today is on desktop1. Log in as student. The goal by end of session is confident navigation — moving around the filesystem, creating and removing directories, and understanding the difference between absolute and relative paths without having to think about it.
Part 1 — Terminals and TTY (15 min)
Ctrl+Alt+T. This is a virtual terminal — a terminal emulator running inside the GUI session.Ctrl+Alt+F3. The screen goes black and shows a login prompt — no GUI, no mouse. Log in as student. You are now in TTY3, a genuine text terminal.who. Record the output and explain what each column means in your lab notes. You should see at least two entries — your GUI session on TTY1 or TTY2, and your current TTY3 session.Ctrl+Alt+F2 (or F1). Verify your desktop is still there — the GUI session keeps running while you use TTYs. Return to your virtual terminal for the rest of the lab.Part 2 — Navigation and directory operations (55 min)
pwd (print working directory). Record the output in your lab notes — this is your starting location. It should be /home/student. Every time you open a terminal, this is where you begin.mkdir lab2. Verify it was created with ls. Note: mkdir creates the directory in your current location — you didn't need to specify the full path because you're already in /home/student.cd / — you are now at the root of the filesystem.
mkdir /home/student/lab2/documents2
ls /home/student/lab2 — you should see documents2.
cd /etc
../../home/student/lab2
mkdir ../../home/student/lab2/backups
ls ../../home/student/lab2 — you should see both documents2 and backups.
../ did you need and why?
rmdir /home/student/lab2/documents2 to remove the documents2 directory.
ls ~/lab2
rmdir only works on empty directories. Try creating a file inside a directory and then removing it with rmdir — observe the error. You will need rm -r for non-empty directories (covered in Part 4).
cd ~ — you are back in /home/student.
cd /var/tmp, then cd - — observe where you end up. cd - toggles between your last two locations.
mkdir my docs — observe what happens. (It creates two directories: "my" and "docs".)
rmdir my docs
mkdir "my docs"
mkdir my\ docs
dir vs. Linux ls:
cd /
ls — a simple listing of contents, colour-coded by type.
ls -l — long format. For the /bin directory entry, record in your lab notes: Permissions · Owner · Group · Size · Date.
ls -la — long format including hidden files (those starting with .).
ls -lh — human-readable file sizes (KB, MB, GB instead of bytes).
dir in Windows is the rough equivalent of ls. But Linux flags give you far more control over the output.
ssh bandit0@bandit.labs.overthewire.org -p 2220 — password is bandit0readme in the home directory. Find it and connect to bandit1. Record the password somewhere safe — you will need it to reconnect.- (a dash). How do you read a file with that name? Think about how the shell interprets a leading dash...Paths, TTY, and what's coming tomorrow
/var/log. Target: /home/student/lab2/backups. Ask for the relative path — take hands. Answer: ../../home/student/lab2/backups. Ask for the absolute — anyone: /home/student/lab2/backups. Point out that the absolute is always the same; the relative changes depending on where you are.find, searching file contents with grep, and creating and manipulating text files. These are the three commands that make the Linux terminal genuinely powerful for a sysadmin. Also: why sudo exists, and when to use it.Learning outcomes — by end of Day 3, students can…
What to have ready before class