Teach Terminal
A browser-based game that teaches Linux terminal commands through interactive lessons and missions.
Today
Today I finished writing all 25 lessons and fixed several issues with the lesson system.
The lessons are organized into 5 sections - Introduction, Navigation, Files, Text & Redirection, and Permissions - plus a final congratulations lesson. Each practice lesson has multiple steps, so instead of a single command to type, the user might create a file, change its permissions, and verify with ls -l. The window tracks progress with markers like [x], [>], and [ ] so it is clear where the user is.
I also fixed bugs I found while testing the flow:
- The lesson window didn’t reset the filesystem between practices. If you completed
mkdir projectsonce, replaying the lesson would fail because the folder already existed. Now the filesystem resets to a clean state at the start of every practice lesson. - Sudo commands weren’t detected by the practice check. The checker only saw the inner command (
chown root file.txt), not the fullsudo chown root file.txt. Fixed by passing the full command through. - Lesson 25 no longer has a practice - it just says “Congratulations! You finished Teach Terminal.” with a short message about what the user learned.
Completed
- index.html - Start menu with Start and Settings buttons
- settings.html - Settings page with three themes (Ubuntu, Hacker, Kali)
- login.html - Login page with username, machine name, and password validation
- mode.html - Mode selection: Free Exploration or Guided Path
- lessons.html - Course overview with sections and lesson cards
- main.html - Interactive terminal interface
- style.css - Main styling, animated gradients, glassmorphism UI, theme colors
- login.css - Login page styling with themed backgrounds
- settings.js - Saves the selected theme using localStorage
- theme.js - Loads the saved theme and applies it automatically
- login.js - Form validation and redirect to mode page
- filesystem.js - Fake Linux filesystem with files, folders, permissions, owners, groups, sizes, and modification times
- terminal.js - Terminal input handling, prompt display, line management, colored output, sudo flow
- command.js - Command recognition and execution
- lessons-data.js - All 25 lessons organized into 5 sections
- lesson.js - Renders the lessons page timeline
- lesson-window.js - Runs the lesson window inside the terminal
Current Commands
pwd, ls, cd, mkdir, touch, echo, cat, rm, cp, mv, chmod, chown, sudo, clear, help, history
With flags for most commands, redirection (>, >>, <, 2>), Tab autocomplete, arrow-key history, !! and !n expansion, and per-command help.
Goal
My goal is to create a realistic Linux terminal that teaches beginners how to use common commands through interactive lessons instead of just reading documentation.
Next Steps
- Add
grep,head,tail - Add pipes (
|) and shell operators (&&,||,;) - Wildcards and brace expansion