Foundation of Command Line Tools — Complete Curriculum
Command-Line Fundamentals — Choose Your Path
Welcome! Before diving into 3D design with OpenSCAD, you’ll master command-line fundamentals. This page will help you understand what command-line interfaces are and choose the best path for you.
What is a Command-Line Interface (CLI)?
A command-line interface is a text-based way to control your computer by typing commands instead of clicking buttons. It’s like sending written instructions to your computer.
Why learn it?
- Speed: Text commands are often faster than clicking through menus
- Precision: Exact control over what your computer does
- Accessibility: Perfect for screen readers - text is naturally readable
- Automation: Repeat tasks automatically
- 3D Printing: Essential for batch processing models and integrating tools
Real-world example
Instead of:
- Opening File Explorer (click)
- Navigating folders (click, click, click)
- Right-clicking a file (click)
- Selecting “Copy” (click)
- Navigating to destination (click, click)
- Right-clicking (click)
- Selecting “Paste” (click)
You type: cp myfile.txt backup/ and press Enter. Done.
Three Command-Line Options on Windows
Windows offers three ways to use the command line. All are accessible with screen readers. Here’s how they compare:
Option 1: Windows Command Prompt (CMD)
What it is: The original Windows command-line (1981-present)
Best for: Absolute beginners, maximum simplicity
Pros:
- Simple commands and syntax
- Minimal learning curve
- Easy to understand error messages
- Great for basic file operations
- Perfect entry point to command-line world
Cons:
- Limited advanced features
- Less powerful than alternatives
- No built-in piping (but available)
- Smaller ecosystem
Typical command:
copy myfile.txt backup\
Option 2: PowerShell
What it is: Microsoft’s modern, powerful shell (2006-present)
Best for: Intermediate users, advanced automation
Pros:
- Very powerful for scripting
- Modern syntax and features
- Excellent for 3D printing automation
- Professional workflows
- Large community
Cons:
- Steeper learning curve than CMD
- More complex syntax
- More “wordy” commands
- Overkill for simple tasks
Typical command:
Copy-Item -Path myfile.txt -Destination backup/
Option 3: Git Bash
What it is: A Unix/Linux shell on Windows (runs bash inside Git for Windows)
Best for: Programmers, users familiar with Linux, advanced users
Pros:
- Familiar if you know Linux/Unix
- Powerful piping and text processing
- Consistent with other platforms (macOS, Linux)
- Excellent for advanced workflows
- Industry-standard for developers
Cons:
- Requires Git installation
- Steeper learning curve
- Path syntax is different from native Windows
- Less integrated with Windows system tools
- May be “too much” for beginners
Typical command:
cp myfile.txt backup/
Command Comparison Table
Here’s how common tasks compare across the three options:
| Task | Command Prompt | PowerShell | Git Bash |
|---|---|---|---|
| Show current location | cd | pwd | pwd |
| List files | dir /B | ls -n | ls |
| Go to folder | cd Documents | cd Documents | cd Documents |
| Go up one level | cd .. | cd .. | cd .. |
| Go home | cd %USERPROFILE% | cd ~ | cd ~ |
| Create folder | mkdir Projects | mkdir Projects | mkdir Projects |
| Create file | echo text > file.txt | echo "text" > file.txt | echo "text" > file.txt |
| Copy file | copy old.txt new.txt | Copy-Item old.txt new.txt | cp old.txt new.txt |
| Move file | move old.txt folder/ | Move-Item old.txt folder/ | mv old.txt folder/ |
| Delete file | del file.txt | Remove-Item file.txt | rm file.txt |
| List with filter | dir /B *.txt | ls *.txt | ls *.txt |
| Save output to file | dir > list.txt | ls > list.txt | ls > list.txt |
| Page through output | dir | more | ls | more | ls | less |
| Search in files | findstr "text" file.txt | Select-String "text" file.txt | grep "text" file.txt |
| Show file contents | type file.txt | cat file.txt or Get-Content | cat file.txt |
| Create script | .bat files | .ps1 files | .sh files |
| Run script | script.bat | .\script.ps1 | ./script.sh |
Feature Comparison Table
| Feature | CMD | PowerShell | Git Bash |
|---|---|---|---|
| Simplicity | Easiest | Moderate | Hardest |
| Beginner-Friendly | Best | Good | Challenging |
| Power/Capability | Basic | Excellent | Excellent |
| Screen Reader Compatible | Perfect | Perfect | Perfect |
| Linux/macOS Skills | Windows-only | Some overlap | Full overlap |
| 3D Printing Automation | Adequate | Excellent | Adequate |
| Learning Curve | Gentle | Moderate | Steep |
| Community Support | Moderate | Excellent | Excellent |
| Windows Integration | Perfect | Perfect | Good |
| Installation Difficulty | Built-in | Built-in | Requires Git |
Quick Learner Profile Test
Answer these questions to find your best match:
Question 1: Experience Level
- A: I’ve never used a command line Easier paths better (CMD or PowerShell)
- B: I’ve used terminals before Any path works
- C: I use macOS or Linux Git Bash most natural
Question 2: What matters most?
- A: Simplicity and quick learning Choose CMD
- B: Power and advanced features Choose PowerShell
- C: Consistency across Windows/Mac/Linux Choose Git Bash
Question 3: Future goals
- A: Just need to manage files for 3D printing CMD is fine
- B: Advanced automation and scripting PowerShell recommended
- C: Professional development workflows Git Bash best
Question 4: Your main concern
- A: Don’t want steep learning curve CMD
- B: Want industry-standard skills Git Bash
- C: Want Microsoft’s modern tool PowerShell
Recommendation by Goal
Goal: “I want to learn the basics and get to 3D printing quickly”
Start with CMD (Command Prompt)
- Simplest syntax
- Fastest to get productive
- All core concepts transfer to others
- Can switch later if needed
Start CMD Foundation — jump to Part 2 ↓
Goal: “I want power and professional automation”
Start with PowerShell
- Microsoft’s modern, recommended tool
- Professional-grade capabilities
- Better for complex 3D printing workflows
- Skills are in-demand
Start PowerShell Foundation — jump to Part 1 ↓
Goal: “I want skills that work on Windows, Mac, and Linux”
Start with Git Bash
- Unix/bash skills transfer everywhere
- Great preparation for professional development
- Consistent across all platforms
- Growing standard in 3D printing tools
Start Git Bash Foundation — jump to Part 3 ↓
Can I Switch Paths Later?
Yes, absolutely! All three teach the same fundamental concepts:
- File navigation and organization
- Creating and managing files/folders
- Combining commands for powerful workflows
- Scripting and automation basics
Once you learn one, switching to another is quick. The concepts are identical; only the syntax changes.
Example: If you learn CMD first, then later want PowerShell’s power, you’ll find it easy. The command cd Documents works the same way in all three.
Important: All Are Equally Accessible
Screen readers work perfectly with all three
- Text-based by nature (perfect for NVDA, JAWS)
- No mouse required
- Output is naturally readable
- Keyboard-only workflows
Note
All three shells — CMD, PowerShell, and Git Bash — work perfectly with NVDA, JAWS, Dolphin SuperNova, and Windows Narrator. Don’t let accessibility concerns influence your choice.
Don’t let accessibility concerns influence your choice. All are fully accessible.
Getting Started: Your Decision
Take a moment and choose:
1. I want the simplest path
Command Prompt Foundation — jump to Part 2 ↓
- Time to first success: ~30 minutes
- Learning curve: Gentlest
- When to upgrade: Once you’re comfortable and want power
2. I want modern, powerful Windows tools
PowerShell Foundation — jump to Part 1 ↓
- Time to first success: ~45 minutes
- Learning curve: Moderate
- Best for: Professional automation, 3D printing workflows
3. I want Unix/Linux skills that work everywhere
Git Bash Foundation — jump to Part 3 ↓
- Time to first success: ~1 hour
- Learning curve: Steeper but rewarding
- Best for: Professional development, cross-platform work
Not Sure? Here’s What Most People Do
If you’re reading this and unsure:
Tip
Start with Command Prompt (CMD). It’s the gentlest introduction, and you’ll be productive quickly. You can always switch to PowerShell or Git Bash later — the concepts transfer completely.
After completing CMD:
- Want more power? PowerShell is next
- Want Linux skills? Git Bash is next
- Want to stick with CMD? You have all the skills you need
FAQ
Q: Do I need to pick now and stick with it forever? A: No. Start with one, try another, switch between them. They’re tools. Use what works.
Q: Will my 3D printing skills work in all three? A: Yes. Once you understand the concepts (file organization, automation, piping), they apply everywhere.
Q: If I pick CMD, can I learn PowerShell later? A: Absolutely. Many learners do exactly this. CMD gets you productive; PowerShell adds power.
Q: Is Git Bash harder? A: Slightly, due to path syntax and Unix conventions. But not dramatically. If you take time with it, you’ll learn it.
Q: Which do professional 3D printing developers use? A: Mix of all three, but Git Bash/Linux is most common in cross-platform teams.
Ready to Begin?
Choose your path above and click to start. Remember:
- Each lesson includes practice exercises
Tip
You can’t break your computer by typing a wrong command. The worst that happens is an error message. Mistakes are learning opportunities — just read the message and try again.
- You can’t break anything
- Mistakes are learning opportunities
- Ask for help if stuck
Let’s get you comfortable with the command line!
Other Screen Readers
Dolphin SuperNova (commercial) and Windows Narrator (built-in) are also supported; the workflows and recommendations in this document apply to them. See https://yourdolphin.com/supernova/ and https://support.microsoft.com/narrator for vendor documentation.
Last Updated: February 2026 Total Duration: ~30–45 hours per track (screen reader users) Target Users: Anyone using a screen reader — NVDA, JAWS, Dolphin SuperNova, Windows Narrator
This combined curriculum covers three command-line environments taught in parallel. Each section follows the same lesson structure (Pre → 0 → 1 → 2 → 3 → 4 → 5 → 6 → Unit Exam) with shell-specific syntax and examples.
Master Table of Contents
Part 1 — PowerShell
| Section | Title | Time |
|---|---|---|
| Screen Reader Accessibility Guide | NVDA, JAWS, and terminal accessibility reference | 1.5 hrs |
| Lesson Pre: Your First Terminal | Opening PowerShell, first commands, basic navigation | 2–2.5 hrs |
| Lesson 0: Getting Started | Paths, shortcuts, tab completion | 1.5 hrs |
| Lesson 1: Navigation | Moving around the file system confidently | 2–2.5 hrs |
| Lesson 2: File and Folder Manipulation | Create, copy, move, delete files and folders | 2.5–3 hrs |
| Lesson 3: Input, Output, and Piping | Chain commands together, redirect output | 2.5–3 hrs |
| Lesson 4: Environment Variables and Aliases | Automate settings, create shortcuts | 2–2.5 hrs |
| Lesson 5: Filling in the Gaps | Profiles, history, debugging | 2–2.5 hrs |
| Lesson 6: Advanced Techniques | Scripts, functions, loops, professional workflows | 4–4.5 hrs |
| Unit Exam | Comprehensive assessment — Lessons 0 through 6 | 60–90 min |
Part 2 — Windows Command Prompt (CMD)
| Section | Title | Time |
|---|---|---|
| Screen Reader Accessibility Guide | NVDA, JAWS, Narrator, and SuperNova reference for CMD | 1.5 hrs |
| Lesson Pre: Your First Terminal | Opening CMD, first commands, basic navigation | 1.5–2 hrs |
| Lesson 0: Getting Started | Paths, shortcuts, tab completion | 1.5 hrs |
| Lesson 1: Navigation | Moving around the file system confidently | 2–2.5 hrs |
| Lesson 2: File and Folder Manipulation | Create, copy, move, delete files and folders | 2.5–3 hrs |
| Lesson 3: Input, Output, and Piping | Redirect output, chain commands with pipes | 2.5–3 hrs |
| Lesson 4: Environment Variables and Aliases | Automate settings, create doskey shortcuts | 2–2.5 hrs |
| Lesson 5: Filling in the Gaps | Autorun scripts, history, debugging | 2–2.5 hrs |
| Lesson 6: Advanced Techniques | Batch scripts, subroutines, loops, professional workflows | 4–4.5 hrs |
| Unit Exam | Comprehensive assessment — Lessons 0 through 6 | 60–90 min |
Part 3 — Git Bash
| Section | Title | Time |
|---|---|---|
| Screen Reader Accessibility Guide | NVDA, JAWS, Narrator, and SuperNova reference for Git Bash | 1–1.5 hrs |
| Tutorial: Git Bash Quick Start | Prompt orientation, core commands, path concepts | 30–45 min |
| Lesson Pre: Your First Terminal | Installing Git Bash, opening it, first commands | 1.5–2 hrs |
| Lesson 0: Getting Started | Paths, ~, ./, ../, tab completion | 20–30 min |
| Lesson 1: Navigation | pwd, cd, ls and flags, wildcards | 1 class period |
| Lesson 2: File and Folder Manipulation | touch, mkdir, cp, mv, rm, rmdir | 30–45 min |
| Lesson 3: Input, Output, and Piping | echo, cat, >, >>, |, clip, grep | 1 class period |
| Lesson 4: Environment Variables and Aliases | $VARNAME, PATH, which, alias, .bashrc | 30–45 min |
| Lesson 5: Filling in the Gaps | history, Ctrl+R, .bashrc, ./ | 30–45 min |
| Lesson 6: Advanced Techniques | Shell scripts, functions, loops, professional workflows | 4–4.5 hrs |
| Unit Exam | Comprehensive assessment — Lessons 0 through 6 | 60–90 min |
Quick Jump — By Lesson Across All Three Shells
| Lesson | PowerShell | CMD | Git Bash |
|---|---|---|---|
| Accessibility Guide | PS | CMD | Git Bash |
| Lesson Pre | PS | CMD | Git Bash |
| Lesson 0: Getting Started | PS | CMD | Git Bash |
| Lesson 1: Navigation | PS | CMD | Git Bash |
| Lesson 2: File & Folder Manipulation | PS | CMD | Git Bash |
| Lesson 3: Input, Output & Piping | PS | CMD | Git Bash |
| Lesson 4: Environment Variables | PS | CMD | Git Bash |
| Lesson 5: Filling in the Gaps | PS | CMD | Git Bash |
| Lesson 6: Advanced Techniques | PS | CMD | Git Bash |
| Unit Exam | PS | CMD | Git Bash |
Part 1 — PowerShell
Last Updated: February 2026
Total Duration: 30–45 hours of instruction and practice (for screen reader users)
Target Users: Anyone using a screen reader (NVDA, JAWS, Dolphin SuperNova, Windows Narrator, or other)
This single file contains the complete PowerShell Foundation curriculum in reading order. All lessons, quizzes, extension problems, and the unit exam are included. No additional files are needed.
Table of Contents
| Section | Title | Estimated Time |
|---|---|---|
| Screen Reader Accessibility Guide | NVDA, JAWS, and terminal accessibility reference | 1.5 hours |
| Lesson Pre: Your First Terminal | Opening PowerShell, first commands, basic navigation | 2–2.5 hours |
| Lesson 0: Getting Started | Paths, shortcuts, tab completion | 1.5 hours |
| Lesson 1: Navigation | Moving around the file system confidently | 2–2.5 hours |
| Lesson 2: File and Folder Manipulation | Create, copy, move, delete files and folders | 2.5–3 hours |
| Lesson 3: Input, Output, and Piping | Chain commands together, redirect output | 2.5–3 hours |
| Lesson 4: Environment Variables and Aliases | Automate settings, create shortcuts | 2–2.5 hours |
| Lesson 5: Filling in the Gaps | Profiles, history, debugging | 2–2.5 hours |
| Lesson 6: Advanced Techniques | Scripts, functions, loops, professional workflows | 4–4.5 hours |
| Unit Exam | Comprehensive assessment — Lessons 0 through 6 | 60–90 minutes |
Total: approximately 30–45 hours including practice exercises
How to Use This File
If you have never used a terminal before: read from the top in order. Do not skip lessons — each builds on the one before it.
If you have used a terminal but not with a screen reader: start with the Accessibility Guide, skim Lesson Pre, then continue from Lesson 0.
If you are experienced with both: jump directly to the lesson you need. Use the quiz at the end of each lesson to self-test before moving on.
Reference while working: the Accessibility Guide and Lesson 0 contain material you will return to throughout the curriculum. Keep a copy open or bookmark those sections.
Curriculum Rules (Read These First)
Rule 1 — Always know where you are.
Every session, first thing: pwd. If you don’t know your path, you’ll get lost.
Rule 2 — Check before you delete.
Before any rm command: ls -n to confirm what you’re about to remove.
Rule 3 — Use -n with ls.
Always ls -n — never bare ls. The -n flag gives one name per line, which screen readers can follow.
Rule 4 — When lost, redirect to a file.
If output is confusing: command > output.txt then notepad.exe output.txt. This always works.
Rule 5 — Save everything you create.
Keep all practice files in a dedicated learning folder: mkdir ~/PS_Learning.
Screen Reader Accessibility Guide
Target Users: NVDA, JAWS, and other screen reader users
Last Updated: 2026
This guide supports the PowerShell Foundation curriculum and helps screen reader users navigate and work efficiently with PowerShell on Windows.
Table of Contents
- Getting Started with Screen Readers
- NVDA-Specific Tips
- JAWS-Specific Tips
- General Terminal Accessibility
- Working with Long Output
- Keyboard Shortcuts Reference
- Troubleshooting
Getting Started with Screen Readers
Which Screen Reader Should I Use?
NVDA is free and often recommended for new users; JAWS is a powerful commercial option. Also consider Dolphin SuperNova and Windows Narrator:
- Dolphin SuperNova: commercial speech, braille and magnification (check vendor docs for keyboard mappings).
- Windows Narrator: built into Windows and useful for quick access without installing third-party software.
Before You Start
- Start your screen reader before opening PowerShell.
- Open PowerShell and listen for the window title and prompt.
- If silent, press Alt+Tab to find the window.
What is PowerShell?
PowerShell is the modern Windows shell and scripting environment. Common commands include Get-ChildItem, Get-Content, and Out-File. PowerShell provides richer objects and piping than CMD.
NVDA-Specific Tips
NVDA is available from https://www.nvaccess.org/
Dolphin SuperNova
Dolphin SuperNova: https://yourdolphin.com/supernova/ — commercial option providing speech and magnification; consult vendor guides for features and commands.
Windows Narrator
Windows Narrator: https://support.microsoft.com/narrator — built-in Narrator has a different set of commands; it can be enabled via Windows Settings > Accessibility.
Key Commands for PowerShell
| Command | What It Does |
|---|---|
| NVDA+Home | Read the current line (your command or output) |
| NVDA+Down Arrow | Read from cursor to end of screen |
| NVDA+Up Arrow | Read from top to cursor |
| NVDA+Page Down | Read next page |
| NVDA+Page Up | Read previous page |
| NVDA+F7 | Open the Review Mode viewer (can scroll through text) |
Example: Reading Long Output
If Get-ChildItem produces many lines, redirect to a file and open it in Notepad:
Get-ChildItem -Name > list.txt
notepad list.txt
-Name prints one item per line (screen reader friendly).
JAWS-Specific Tips
JAWS is available from https://www.freedomscientific.com/
Key Commands for PowerShell
| Command | What It Does |
|---|---|
| Insert+Down Arrow | Read line by line downward |
| Insert+Up Arrow | Read line by line upward |
| Insert+Page Down | Read next page of text |
| Insert+Page Up | Read previous page of text |
Example: Reading Long Output
- Redirect:
Get-ChildItem -Name > list.txt - Open Notepad:
notepad list.txt - Use Insert+Ctrl+Down to read full contents.
General Terminal Accessibility
Understanding the PowerShell Layout
PowerShell shows a title bar, content area, and a prompt that looks like:
PS C:\Users\YourName>
Navigation Sequence
- Screen reader announces the title
- Then it announces the prompt line
- Anything above prompt is prior output
Working with Long Output
Solution 1: Redirect to a File
Get-ChildItem -Name > list.txt
notepad list.txt
Solution 2: Use Pagination
Get-Content largefile.txt | more
Solution 3: Filter Output
Get-ChildItem -Name | Where-Object { $_ -like "*.scad" }
Solution 4: Count Before Displaying
(Get-ChildItem -Name).Count
Keyboard Shortcuts Reference
| Key | Action |
|---|---|
| Up Arrow | Show previous command |
| Down Arrow | Show next command |
| Tab | Auto-complete file/folder names |
| Home | Jump to start of line |
| End | Jump to end of line |
| Ctrl+C | Stop command |
| Enter | Run command |
Troubleshooting
Problem: “I Can’t Hear the Output”
- Redirect to file and open in Notepad.
- Use End to jump to the end of text.
Problem: “Tab Completion Isn’t Working”
- Type some characters before Tab.
Problem: “Command Not Found”
- Use
Get-Command programnameto check availability.
Pro Tips
- Use
Get-ChildItem -Namefor one-per-line listings. - Use
Out-File -FilePath list.txtto capture output with encoding options.
Recommended Workflow
Set-Location(orcd) to the project folderGet-ChildItem -Nameto list files- Redirect large output to files and open in Notepad
Additional Resources
- NVDA Documentation: https://www.nvaccess.org/documentation/
- JAWS Documentation: https://www.freedomscientific.com/support/
- PowerShell Documentation: https://docs.microsoft.com/powershell
- NVDA Documentation: https://www.nvaccess.org/documentation/
- JAWS Documentation: https://www.freedomscientific.com/support/
- Dolphin SuperNova: https://yourdolphin.com/supernova/
- Windows Narrator: https://support.microsoft.com/narrator
Lesson Pre: Your First Terminal
Duration: 1.5-2 hours (for screen reader users)
Prerequisites: None - this is the starting point
Accessibility Note: This lesson is designed specifically for screen reader users (NVDA, JAWS)
What is a Terminal?
A terminal (also called a command line or shell) is a text-based interface where you type commands instead of clicking buttons. Think of it like sending written instructions to your computer instead of pointing and clicking.
Why learn this?
- Faster and more precise work (especially for 3D printing scripts and automation)
- Essential for programming and using tools like OpenSCAD
- Accessibility: Many command line tools work perfectly with screen readers
- Scripting: Automate repetitive tasks
Opening PowerShell for the First Time
3DMake: Your First Real-World Goal
3DMake (github.com/tdeck/3dmake) is a free, accessibility-first command-line tool for designing and 3D-printing models entirely from the terminal — no mouse required. Every PowerShell skill in this curriculum directly supports a real 3DMake workflow.
Here is the end goal — one command that builds your OpenSCAD model, slices it, and sends it to the printer:
# Navigate to your project folder
cd ~/Documents/3d_projects/my_cube
# Build, slice, and print in a single command
3dm build slice print
Keep this goal in mind as you work through each lesson.
Opening PowerShell for the First Time
On Windows
Method 1: Search (Easiest)
- Press the Windows key alone
- You should hear “Search”
- Type:
PowerShell - You’ll hear search results appear
- Press Enter to open the first result (Windows PowerShell)
- PowerShell will open in a new window
Method 2: Using the Start Menu
- Press Windows key + X (opens the Quick Link menu)
- Look for “Windows PowerShell” or “Terminal”
- Press Enter
Method 3: From File Explorer
- Open File Explorer
- Navigate to any folder
- In the menu bar, select “File” -> “Open Windows PowerShell here”
- PowerShell opens in that folder location
First Connection: Understanding the Prompt
When PowerShell opens, your screen reader will announce the window title and then the prompt. The prompt is where you type commands.
What you’ll hear:
PS C:\Users\YourName>
What this means:
PS= “PowerShell” indicatorC:\Users\YourName= Your current location (the “path”)>= The prompt is ready for your input
Important
Your cursor is blinking right after the
>. This is where you type.
Your First Commands (Screen Reader Edition)
Command 1: “Where Am I?” - pwd
What it does: Tells you your current location
Type this:
pwd
Press Enter
What you’ll hear: Your screen reader will announce the current path, something like:
C:\Users\YourName
Understanding paths:
- Paths show your location in the file system (like a mailing address)
- Windows paths use backslashes:
C:\Users\YourName\Documents - Think of it like folders inside folders:
C:\(main drive) ->Users->YourName->Documents
Command 2: “What’s Here?” - ls -n
What it does: Lists all files and folders in your current location. The -n flag makes it screen-reader friendly (names only, one per line)
Type this:
ls -n
Press Enter
What you’ll hear: Your screen reader will announce each file and folder name, one per line:
Desktop
Documents
Downloads
Music
Pictures
...
Why -n?
- Without
-n, PowerShell shows files in columns (hard to read with a screen reader) - With
-n, each file/folder is on its own line (perfect for screen readers)
Command 3: “Go There” - cd Documents
What it does: Changes your location (navigates to a folder)
Type this:
cd Documents
Press Enter
What you’ll hear: The prompt changes to show your new location. You might hear something like:
PS C:\Users\YourName\Documents>
Practice navigation:
- Run
pwdto confirm you’re in Documents - Run
ls -nto see what files are in Documents - Try going back:
cd ..(the..means “go up one level”) - Run
pwdagain to confirm - Go back to Documents:
cd Documents
Reading Screen Reader Output (Critical Skills)
Dealing with Long Lists
When you run ls -n in a folder with many files, the list might be very long. Your screen reader might announce 50+ items rapidly.
Solution 1: Save to a File
ls -n > list.txt
notepad.exe list.txt
This saves the list to a file and opens it in Notepad where you can read it more slowly.
Solution 2: Search Within the Output
ls -n | findstr "search-term"
Example: If you’re looking for files containing “scad”, type:
ls -n | findstr "scad"
Navigating Tab Completion
One of the most powerful screen reader tricks is Tab completion:
How it works:
- Type the first few letters of a folder or file name
- Press Tab
- PowerShell automatically completes the rest
Example:
- You’re in
C:\Users\YourName> - Type:
cd Doc - Press Tab
- PowerShell auto-completes it to:
cd Documents - Press Enter to go there
With a screen reader:
- As you type
Doc, your screen reader announces each letter - When you press Tab, PowerShell types the rest and your screen reader announces the full command
- This is much faster than typing the whole thing
Creating and Editing Files
Create a Simple File
Type this:
echo "Hello, PowerShell!" > hello.txt
What this does:
echosends text to the screen (or file)"Hello, PowerShell!"is the text>redirects it to a file calledhello.txt
Read the File Back
Type this:
cat hello.txt
What you’ll hear: Your screen reader announces:
Hello, PowerShell!
Open and Edit the File
Type this:
notepad.exe hello.txt
This opens the file in Notepad where you can edit it with your screen reader.
Essential Keyboard Shortcuts
These work in PowerShell and are crucial for screen reader users:
| Key Combination | What It Does |
|---|---|
| Up Arrow | Shows your previous command (press again to go further back) |
| Down Arrow | Shows your next command (if you went back) |
| Tab | Auto-completes folder/file names |
Important
Ctrl+C stops any running command immediately. If a command seems frozen or is producing endless output, press Ctrl+C to regain control of the prompt.
| Ctrl+C | Stops a running command | | Ctrl+L | Clears the screen | | Enter | Runs the command |
Screen reader tip: These all work perfectly with your screen reader. Try them!
Screen Reader-Specific Tips
NVDA Users
-
Reading Command Output:
- Use NVDA+Home to read the current line
- Use NVDA+Down Arrow to read to the end of the screen
- Use NVDA+Page Down to read the next page
-
Reviewing Text:
- Use NVDA+Shift+Page Up to review text above
JAWS Users
-
Reading Output:
- Use Insert+Down Arrow to read line-by-line
- Use Insert+Page Down to read by page
- Use Insert+End to jump to the end of text
-
Reading All Text:
- Use Insert+Down Arrow repeatedly
- Or use Insert+Ctrl+Down to read to the end
Common Issue: “I Can’t Hear the Output”
Problem: You run a command but don’t hear the output
Solutions:
- Make sure your cursor is at the prompt (try pressing End or Ctrl+End)
- Use Up Arrow to go back to your previous command and review it
- Try redirecting to a file:
command > output.txtthen open the file - In NVDA: Try pressing NVDA+F7 to open the Review Mode viewer
Practice Exercises
Complete these in order. Take your time with each one:
Exercise 1: Basic Navigation
- Open PowerShell
- Run
pwdand note your location - Run
ls -nand listen to what’s there - Try
cd Documentsor another folder - Run
pwdto confirm your new location - Run
ls -nin this new location
Goal: You should be comfortable knowing where you are and what’s around you
Exercise 2: Using Tab Completion
- In your home directory, type
cd D(just the letter D) - Press Tab
- PowerShell should auto-complete to a folder starting with D
- Repeat with other folder names
- Try typing a longer name:
cd Downand Tab toDownloads
Goal: Tab completion should feel natural
Exercise 3: Creating and Viewing Files
- Create a file:
echo "Test content" > test.txt - View it:
cat test.txt - Create another:
echo "Line 2" > another.txt - List both:
ls -n
Goal: You understand create, view, and list operations
Exercise 4: Going Up Levels
- Navigate into several folders:
cd Documents, thencd folder1, etc. - From deep inside, use
cd ..multiple times to go back up - After each
cd .., runpwdto confirm your location
Goal: You understand relative navigation with ..
Exercise 5: Redirecting Output
- Create a list:
ls -n > directory_list.txt - Open it:
notepad.exe directory_list.txt - Read it with your screen reader
- Close Notepad
- Verify the file exists:
ls -n | findstr "directory"
Goal: You can save long outputs to files for easier reading
Checkpoint Questions
After completing this lesson, you should be able to answer:
- What does
pwddo? - What does
ls -ndo? - Why do we use
-nwithls? - What path are you in right now?
- How do you navigate to a new folder?
- How do you go up one level?
- What’s the Tab key for?
- What does
echo "text" > file.txtdo? - How do you read a file back?
- How do you stop a command that’s running?
You should be able to answer all 10 with confidence before moving to Lesson 0.
Common Questions
Q: Do I need to use PowerShell? Can I use Command Prompt (cmd.exe)? A: PowerShell is more powerful and works better with modern tools. We recommend PowerShell, but Command Prompt basics are similar.
Tip
If your screen reader isn’t announcing terminal output, use
command > file.txtto save output to a file, then open it withnotepad.exe file.txtfor reliable reading. This trick works with all four screen readers throughout the curriculum.
Q: Why is my screen reader not reading the output?
A: This is common. Use command > file.txt to save output to a file, then open it with Notepad for reliable reading.
Q: What if I type something wrong? A: Just press Enter and you’ll see an error message. Type the correct command on the next line. No harm done!
Q: How do I get help with a command?
A: Type Get-Help command-name (we’ll cover this in Lesson 0)
Q: Can I make PowerShell more accessible? A: Yes! We’ll cover customization in Lesson 5.
Next Steps
Once you’re comfortable with these basics:
- Move to Lesson 0: Getting Started for deeper path understanding
- Then continue through Lessons 1–5 for full terminal mastery
Resources
- Microsoft PowerShell Docs: https://docs.microsoft.com/powershell/
- NVDA Screen Reader: https://www.nvaccess.org/
- JAWS Screen Reader: https://www.freedomscientific.com/products/software/jaws/
- Windows Terminal Accessibility: https://docs.microsoft.com/windows/terminal/
Troubleshooting
| Issue | Solution |
|---|---|
| PowerShell won’t open | Try searching Windows, or right-click a folder and select “Open PowerShell here” |
| Can’t hear the output | Try redirecting to a file: command > output.txt |
| Tab completion not working | Make sure you typed at least one character before pressing Tab |
| Command not found | Make sure you spelled it correctly; try Get-Command to see available commands |
| Stuck in a command | Press Ctrl+C to stop it |
Still stuck? The checkpoint questions and exercises are your best teacher. Work through them multiple times until comfortable.
Other Screen Readers
Dolphin SuperNova (commercial) and Windows Narrator (built-in) are also supported; the workflows and recommendations in this document apply to them. See https://yourdolphin.com/supernova/ and https://support.microsoft.com/narrator for vendor documentation.
Lesson 0: Getting Started — Layout, Paths, and the Shell
Estimated time: 20-30 minutes
Learning Objectives
- Launch PowerShell and locate the prompt
- Understand path notation and shortcuts (
~,./,../) - Use tab completion to navigate quickly
Materials
- Computer with PowerShell
- Editor (Notepad/VS Code)
Step-by-step Tasks
- Open PowerShell and note the prompt (it includes the current path).
- Run
pwdand say or note the printed path. - Use
ls -nto list names in your home directory. - Practice
cd Documents,cd ../andcd ~until comfortable. - Try tab-completion: type
cd ~/Dand press Tab.
Checkpoints
- Confirm you can state your current path and move to
Documents.
Quiz - Lesson PS.0
3DMake Quick-Start: Your First Real Project
You now know enough PowerShell to set up a real 3DMake project. Do this now — it is the fastest path to a printed object.
Step 1 — Download and run the 3DMake setup wizard:
# Go to your Downloads folder (where you extracted 3dmake_windows.zip)
cd ~/Downloads/3dmake
# Run the guided setup (answer the questions about your printer)
./3dm setup
Step 2 — Create your first project:
# Create a folder for all your 3D projects
mkdir ~/Documents/3d_projects
# Create your first project folder and initialize it
mkdir ~/Documents/3d_projects/my_cube
cd ~/Documents/3d_projects/my_cube
3dm new
Step 3 — Confirm the project structure:
# You should see three items: src, build, and 3dmake.toml
ls -n
You just used mkdir, cd, and ls -n on a real project. You are ready to print.
Checkpoints
- Confirm you can state your current path and move to
Documents.
Quiz - Lesson PS.0
- What is a path?
- What does
~mean? - How do you autocomplete a path?
- How do you go up one directory?
- What command lists only names (
lsflag)? - True or False: On Windows, PowerShell uses backslashes (
\) in paths, but forward slashes (/) are also accepted. - Explain the difference between an absolute path and a relative path.
- If you are in
C:\Users\YourName\Documentsand you typecd ../, where do you end up? - What happens when you press Tab while typing a folder name in PowerShell?
- Describe a practical reason why understanding paths is important for a 3D printing workflow.
- What does
./mean in a path, and when would you use it? - If a folder path contains spaces (e.g.,
Program Files), how do you navigate to it withcd? - Explain what the prompt
PS C:\Users\YourName>tells you about your current state. - How would you navigate to your home directory from any location using a single command?
- What is the advantage of using relative paths (like
../) versus absolute paths in automation scripts?
Extension Problems
- Create a nested folder and practice
cdinto it by typing partial names and using Tab. - Use
ls -n -afto list only files in a folder. - Save
pwdoutput to a file and open it in Notepad. - Try
cdinto a folder whose name contains spaces; observe how quotes are handled. - Create a short note file and open it from PowerShell.
- Build a folder structure that mirrors your project organization; navigate to each level and document the path.
- Create a script that prints your current path and the total number of files in it; run it from different locations.
- Investigate the special paths (e.g.,
$HOME,$PSScriptRoot); write down what each contains and when you’d use them. - Compare absolute vs. relative paths by navigating to the same folder using each method; explain which is easier for automation.
- Create a PowerShell function that changes to a frequently-used folder and lists its contents in one command; test it from different starting locations.
- Navigate to three different locations and at each one note the prompt, the path from
pwd, and verify you understand what each shows. - Create a complex folder tree (at least 5 levels deep) and navigate it using only relative paths; verify your location at each step.
- Document all shortcuts you know (
~,./,../,$HOME) and demonstrate each one works as expected. - Write a guide for a peer on how to understand the PowerShell prompt and path notation without using GUI file explorer.
- Create a troubleshooting flowchart: if someone says “I don’t know where I am,” what commands do you give them to find out?
References
- Microsoft. (2024). PowerShell scripting overview and documentation. https://learn.microsoft.com/powershell/scripting/overview
- Microsoft. (2024). Filesystem navigation in PowerShell. https://learn.microsoft.com/powershell/scripting/learn/shell/navigate-the-filesystem
- Microsoft. (2024). Accessibility features in PowerShell ISE. https://learn.microsoft.com/powershell/scripting/windows-powershell/ise/accessibility-in-windows-powershell-ise
Helpful Resources
- PowerShell Basics - Microsoft Learn
- Filesystem Navigation Guide
- Understanding Path Notation
- Tab Completion Reference
- Accessibility in PowerShell ISE
Lesson 1: Navigation — Moving Around Your File System
Duration: 1 class period
Prerequisite: Lesson 0 (Getting Started)
Learning Objectives By the end of this lesson, you will be able to:
- Use
pwdto print your current location - Use
cdto move between directories - Use
ls(and its flags) to list files and folders - Use wildcards
*and?to filter listings - Navigate relative vs. absolute paths
- Search for files by name and extension
Materials
- PowerShell
- Text editor (Notepad or VS Code)
Commands Covered in This Lesson
| Command | What It Does |
|---|---|
pwd | Print Working Directory - shows where you are |
cd path | Change Directory - move to a new location |
ls | List - shows files and folders in current location |
ls -n | List names only (screen reader friendly) |
ls -n -af | List names of files only |
ls -n -ad | List names of directories only |
ls *.extension | List files matching a pattern |
pwd - Where Am I?
Type pwd and press Enter. PowerShell prints the full path to your current location.
pwd
# Output: C:\Users\YourName
When to use: Always run this if you’re unsure of your current location.
cd - Changing Directories
cd stands for “change directory.”
# Go to Documents
cd Documents
# Go up one level to parent directory
cd ..
# Go to home directory
cd ~
# Go to a specific path
cd C:\Users\YourName\Documents\3D_Projects
ls - Listing Files and Folders
Use ls -n for screen reader compatibility.
# List all files and folders (names only)
ls -n
# List only files (no folders)
ls -n -af
# List only folders (no files)
ls -n -ad
Wildcards - Finding Files by Pattern
Wildcards help you find files without typing the full name.
* (asterisk) matches any number of characters:
# List all .scad files
ls -n *.scad
# List all files starting with "part"
ls -n part*
# List all files ending with "_final"
ls -n *_final*
? (question mark) matches exactly one character:
# Find files like model1.scad, model2.scad (but not model12.scad)
ls -n model?.scad
Step-by-step Practice
3DMake in Practice: Navigating a Project
Navigation commands are exactly what you need to explore and manage 3DMake projects:
# Go to your project root
cd ~/Documents/3d_projects/my_cube
# See the project layout: src/, build/, 3dmake.toml
ls -n
# Enter the source folder where your .scad model files live
cd src
ls -n
# Open the main model in your text editor
3dm edit-model
# Go back to project root, then check the build output
cd ..
cd build
ls -n *.stl # list any STL files already built
# Return to project root
cd ..
# Use wildcards to find all projects with "cube" in the name
ls -n ~/Documents/3d_projects/*cube*
Tab completion makes navigation fast: type cd ~/Doc and press Tab.
Step-by-step Practice
- Run
pwdand confirm your location - Move to
Documents:cd Documents - Confirm you moved:
pwd - List files and folders:
ls -n - List only files:
ls -n -af - Go back up:
cd .. - Search for files:
ls -n *.txt
Checkpoints
After this lesson, you should be able to:
- Navigate to any folder using
cd - Confirm your location with
pwd - List files and folders with
ls -n - Use wildcards to find files by pattern
- Move between absolute and relative paths confidently
Quiz - Lesson PS.1
- What does
pwdshow? - How do you list directories only with
ls? - What wildcard matches any number of characters?
- How do you list files with the
.scadextension? - Give an example of an absolute path and a relative path.
- True or False: The
*wildcard matches exactly one character. - Explain the difference between
ls -nandls -n -ad. - Write a command that would list all
.txtfiles in your Documents folder using a wildcard. - How would you search for files containing “part” in their name across multiple files?
- Describe a practical scenario where using wildcards saves time in a 3D printing workflow.
- What happens when you use
ls -n part?.scadversusls -n part*.scad? - How would you navigate to a folder whose name contains both spaces and special characters?
- If you’re in
/Documents/Projects/3Dand you want to go to/Documents/Resources, what command would you use? - Write a command sequence that navigates to the Downloads folder, lists only files, then returns to home.
- Explain the purpose of using
ls -n -afspecifically in a screen reader context.
Extension Problems
- Write a one-line script that lists
.scadfiles and saves toscad_list.txt. - Use
ls -n ~/Documents | moreto page through long listings. - Combine
lswithSelect-Stringto search for a filename pattern. - Create a shortcut alias in the session for a long path and test it.
- Practice tab-completion in a directory with many similarly named files.
- Build a PowerShell script that recursively lists all
.scadand.stlfiles in a directory tree; save the results to a file. - Compare the output of
ls,Get-ChildItem, andgcito understand PowerShell aliasing; document what each command does. - Create a filtering command that displays only files modified in the last 7 days; test it on your documents folder.
- Write a non-visual guide to PowerShell navigation; include descriptions of common patterns and how to verify directory contents audibly.
- Develop a navigation workflow for a typical 3D printing project: move between CAD, slicing, and print-log folders efficiently; document the commands.
- Create a complex wildcard search: find all files in a folder and subfolders that match multiple patterns (e.g.,
*_v1.* OR *_final.*). - Build a script that navigates through a folder tree, counts files at each level, and reports the structure.
- Document the output differences between
ls -n,ls -n -af,ls -n -ad, andGet-ChildItem; explain when to use each. - Create a navigation “cheat sheet” as a PowerShell script that prints common paths and how to navigate to them.
- Design a project folder structure on your computer, document each path, then create a script that validates all folders exist.
References
- Microsoft. (2024). Get-ChildItem cmdlet reference. https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-childitem
- Microsoft. (2024). PowerShell wildcards and filtering. https://learn.microsoft.com/powershell/scripting/learn/shell/using-wildcards
- Microsoft. (2024). Navigation best practices in PowerShell. https://learn.microsoft.com/powershell/scripting/learn/shell/navigate-the-filesystem
Helpful Resources
- Get-ChildItem Cmdlet Reference
- PowerShell Wildcards and Filtering
- Navigation Best Practices
- Relative and Absolute Paths
- Screen Reader Tips for PowerShell
Lesson 2: File and Folder Manipulation
Estimated time: 30-45 minutes
Learning Objectives
- Create, copy, move, and delete files and folders from PowerShell
- Use
ni,mkdir,cp,mv,rm, andrmdirsafely - Understand when operations are permanent and how to confirm results
Materials
- PowerShell
- Small practice folder for exercises
Step-by-step Tasks
- Create a practice directory:
mkdir ~/Documents/PS_Practiceandcdinto it. - Create two files:
ni file1.txtandni file2.txt. - Copy
file1.txttofile1_backup.txtwithcpand confirm withls -n. - Rename
file2.txttonotes.txtusingmvand confirm. - Delete
file1.txtwithrmand verify the backup remains.
Checkpoints
- After step 3 you should see both the original and the backup file.
3DMake in Practice: Organizing Your Projects
File management commands are essential for 3DMake project organization:
# Create a new project from scratch
mkdir ~/Documents/3d_projects/bottle_cap
cd ~/Documents/3d_projects/bottle_cap
3dm new
# Back up a working project before making big changes
cd ~/Documents/3d_projects
cp -r bottle_cap bottle_cap_backup
# Rename the main model file to something more specific
cd bottle_cap/src
mv main.scad bottle_cap.scad
# List only .scad files to confirm the rename
ls -n *.scad
# Delete a draft STL you no longer need
rm ~/Documents/3d_projects/bottle_cap/build/draft.stl
# Now build the renamed model (using the -m flag to specify the name)
cd ~/Documents/3d_projects/bottle_cap
3dm build -m bottle_cap
# See the fresh output in the build folder
ls -n build/
Checkpoints
- After step 3 you should see both the original and the backup file.
Quiz - Lesson PS.2
- How do you create an empty file from PowerShell?
- What command copies a file?
- How do you rename a file?
- What does
rm -rdo? - Why is
rmpotentially dangerous? - True or False:
cprequires the-rflag to copy both files and folders. - Explain the difference between
rmandrmdir. - If you delete a file with
rm, can you recover it from PowerShell? - Write a command that would copy an entire folder and all its contents to a new location.
- Describe a practical safety check you would perform before running
rm -ron a folder.
Caution
By default,
cpsilently overwrites an existing file at the destination with no warning. Usecp -i(interactive) to get a confirmation prompt before overwriting, especially when working with important files.
- What happens if you
cpa file to a destination where a file with the same name already exists? How would you handle this safely? - Compare
mv old_name.txt new_name.txtvsmv old_name.txt ~/Documents/new_name.txt. What is the key difference? - Design a workflow to safely delete 50 files matching the pattern
*.bakfrom a folder containing 500 files. What commands and verifications would you use? - Explain how you could back up all
.scadfiles from a project folder into a timestamped backup folder in one command. - When organizing a 3D printing project, you need to move completed designs to an archive folder and delete failed prototypes. How would you structure this as a safe, auditable process?
Extension Problems
- Create a folder tree and copy it to a new location with
cp -r. - Write a one-line command that creates three files named
a b cand lists them. - Move a file into a new folder and confirm the move.
- Use wildcards to delete files matching a pattern in a safe test folder.
- Export a listing of the practice folder to
practice_listing.txt. - Create a backup script that copies all
.scadfiles from your project folder to a backup folder with timestamp naming. - Build a safe deletion workflow: list files matching a pattern, verify count, then delete with confirmation; document the steps.
- Write a PowerShell script that organizes files by extension into subfolders; test it on a sample folder tree.
- Create a file operation audit trail: log all copy, move, and delete operations to a text file for review.
- Develop a project template generator: a script that creates a standard folder structure for a new 3D printing project with essential subfolders.
- Implement a file conflict handler: write a script that handles cases where
cpwould overwrite an existing file by renaming the existing file with a timestamp before copying. - Create a batch rename operation: use a script to rename all files in a folder from
old_prefix_*tonew_prefix_*; test with actual files and verify the results. - Build a folder comparison tool: list all files in two folders and identify which files exist in one but not the other; output to a report.
- Write a destructive operation validator: before executing
rm -r, create a script that lists exactly what will be deleted, shows file counts by type, and requires explicit user confirmation to proceed. - Design a complete project lifecycle workflow: create folders for active projects, completed designs, and archive; include move operations between folders, backup steps, and verification that all files arrive intact.
References
- Microsoft. (2024). New-Item cmdlet reference. https://learn.microsoft.com/powershell/module/microsoft.powershell.management/new-item
- Microsoft. (2024). Copy-Item and Move-Item cmdlets. https://learn.microsoft.com/powershell/module/microsoft.powershell.management/copy-item
- Microsoft. (2024). File system operations guide. https://learn.microsoft.com/powershell/scripting/learn/shell/manipulating-items
Helpful Resources
- New-Item Cmdlet Reference
- Copy-Item and Move-Item
- Remove-Item Cmdlet Reference
- File System Operations Guide
- Safe Deletion Practices
Lesson 3: Input, Output, and Piping
Duration: 1 class period Prerequisite: Lesson 2 (File and Folder Manipulation)
Learning Objectives
By the end of this lesson, you will be able to:
- Use
echoto print text to the screen - Use
catto read file contents - Use
>to redirect output into a file - Use
|(pipe) to send one command’s output to another - Copy output to the clipboard with
clip - Open files with a text editor from the command line
Commands Covered
| Command | What It Does |
|---|---|
echo "text" | Print text to the screen |
cat filename | Print the contents of a file |
> filename | Redirect output into a file (overwrites) |
>> filename | Append output to a file (adds to end) |
| | Pipe - send output from one command to the next |
clip | Copy piped input to the Windows clipboard |
notepad.exe filename | Open a file in Notepad |
echo - Printing Text
echo prints text to the screen. It is useful for testing, for writing text into files, and for understanding how piping works.
echo "Hello, World"
echo "This is a test"
cat - Reading Files
cat prints the contents of a file to the screen.
# Read a text file
cat ~/Documents/notes.txt
# Read an OpenSCAD file
cat ~/Documents/OpenSCAD_Projects/project0.scad
With a long file, use cat filename | more to read it page by page (press Space to advance, Q to quit).
> - Redirecting Output to a File
The > symbol redirects output from the screen into a file instead.
# Create a file with a single line
echo "Author: Your Name" > header.txt
# Confirm the file was created and has content
cat header.txt
Warning
>overwrites the file if it already exists. Use>>to append instead:
echo "Date: 2025" >> header.txt
echo "Project: Floor Marker" >> header.txt
cat header.txt
| - Piping
The pipe symbol | sends the output of one command to the input of the next. This lets you chain commands together.
# List files and send the list to clip (copies to clipboard)
ls -n | clip
## 3DMake in Practice: Capturing Build Output
Piping and redirection are essential for working with 3DMake's output accessibly:
```powershell
# Build and save the full log to a file so you can read it in Notepad
3dm build > build_log.txt
notepad.exe build_log.txt
# Build and slice, keeping only lines with errors or warnings
3dm build slice 2>&1 | Select-String -Pattern "error|warning" -CaseSensitive:$false
# List all STL files produced so far
ls -n build/ | findstr ".stl"
# Get a list of available printer profiles and save for reference
3dm list-profiles > profiles.txt
notepad.exe profiles.txt
# Get a list of material overlays (PLA, PETG, supports, etc.)
3dm list-overlays > overlays.txt
notepad.exe overlays.txt
# Get an AI description of your model and save it
3dm info > model_description.txt
notepad.exe model_description.txt
# List files and send the list to clip (copies to clipboard)
ls -n | clip
# Now paste with Ctrl + V anywhere
# Search within a file's contents using Select-String (like grep)
cat project0.scad | Select-String "cube"
clip - Copying to Clipboard
clip takes whatever is piped to it and puts it on the Windows clipboard.
# Copy your current directory path to the clipboard
pwd | clip
# Copy a file listing to clipboard
ls -n | clip
# Copy the contents of a file to clipboard
cat notes.txt | clip
After any of these, press Ctrl + V in any application to paste.
Opening Files in Notepad
# Open a file in Notepad
notepad.exe ~/Documents/notes.txt
# Open a .scad file
notepad.exe ~/Documents/OpenSCAD_Projects/project0.scad
# Create a new file and open it
notepad new_notes.txt
Step-by-step Tasks
- Create
practice.txtwith three lines usingechoand>/>>. - Read the file with
cat practice.txt. - Pipe the file into
Select-Stringto search for a word. - Copy the file contents to clipboard with
cat practice.txt | clip. - Redirect
ls -nintolist.txtand open it in Notepad. Checkpoints
- After step 3 you should be able to find a keyword using piping.
Quiz - Lesson PS.3
- What is the difference between
>and>>? - What does the pipe
|do? - How do you copy output to the clipboard?
- How would you page through long output?
- How do you suppress output to nowhere?
- True or False: The pipe operator
|connects the output of one command to the input of another. - Explain why redirecting output to a file is useful for screen reader users.
- Write a command that would search for the word “sphere” in all
.scadfiles in a directory. - How would you count the number of lines in a file using PowerShell piping?
- Describe a practical scenario in 3D printing where you would pipe or redirect command output.
- What would be the difference in output between
echo "test" > file.txt(run twice) vsecho "test" >> file.txt(run twice)? Show the expected file contents. - Design a three-step piping chain: read a file, filter for specific content, and save the results; explain what each pipe does.
- You have a 500-line
.scadfile and need to find all instances ofsphere()and count them. Write the command. - Explain how
clipis particularly valuable for screen reader users when working with file paths or long output strings. - Describe how you would use pipes and redirection to create a timestamped backup report of all
.stlfiles in a 3D printing project folder.
Extension Problems
- Use piping to count lines in a file (hint:
Select-String -Pattern '.' | Measure-Object). - Save a long
ls -noutput and search it withSelect-String. - Chain multiple pipes to filter and then save results.
- Practice copying different command outputs to clipboard and pasting.
- Create a small script that generates a report (counts of files by extension).
- Build a data processing pipeline: read a CSV file, filter rows, and export results; document each step.
- Write a script that pipes directory listing to Count occurrences of each file extension; create a summary report.
- Create a log analysis command: read a log file, filter for errors, and save matching lines to a separate error log.
- Design a piping workflow for 3D printing file management: find
.stlfiles, extract their sizes, and generate a report. - Develop a reusable piping function library: create functions for common filtering, sorting, and reporting patterns; test each function with different inputs.
- Build a complex filter pipeline: read a
.scadfile, extract lines containing specific geometry commands, count each type, and output a summary to both screen and file. - Create an interactive piping tool: build a script that accepts user input for a search term, pipes through multiple filters, and displays paginated results.
- Develop a performance analysis tool: use piping to combine file listing, metadata extraction, and statistical reporting; export results to a dated report file.
- Implement a comprehensive error-handling pipeline: read output, catch errors, log them separately, and generate a summary of successes vs failures.
- Design and execute a real-world project backup workflow: use piping to verify file integrity, count files by type, generate a backup manifest, and create audit logs-all in one integrated command pipeline.
References
- Microsoft. (2024). Out-File cmdlet for redirection. https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/out-file
- Microsoft. (2024). Select-String piping reference. https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-string
- Microsoft. (2024). PowerShell pipeline concepts. https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-pipeline
Helpful Resources
- Using Out-File for Redirection
- Piping and Select-String
- Get-Content Cmdlet Reference
- Measure-Object for Counting
- PowerShell Pipeline Concept
Lesson 4: Environment Variables, PATH, and Aliases
Estimated time: 30-45 minutes
Learning Objectives
- Read environment variables with
$env:VARNAME - Inspect and verify programs in the
PATH - Create temporary aliases and understand making them persistent via the profile
Materials
- PowerShell (with rights to open profile if desired)
Step-by-step Tasks
- Show your username and home path with
echo $env:USERNAMEandecho $env:USERPROFILE. - Inspect
echo $env:PATHand identify whetheropenscadorcodewould be found. - Run
Get-Command openscadand note the result. - Create a temporary alias:
Set-Alias -Name preview -Value openscadand testpreview myfile.scad. - Open your profile (
notepad.exe $PROFILE) and add the alias line to make it persistent (advanced).
Checkpoints
- After step 3 you can determine whether a program will be found by
PATH.
Quiz - Lesson PS.4
3DMake in Practice: Aliases and Profile Setup
PowerShell aliases and profile scripts make your 3DMake workflow much faster:
# Quick function to jump to your 3D projects folder
function 3dp { Set-Location ~/Documents/3d_projects }
# Quick function to run the full build-slice-print pipeline
function 3dprint { 3dm build slice print }
# Quick function to build and get an AI model description
function 3dinfo { 3dm build; 3dm info }
# Add these functions to your PowerShell profile so they load every session
notepad.exe $PROFILE
# (Paste the three functions above into the file, then save)
# Reload your profile without restarting PowerShell
. $PROFILE
# Now use them:
3dp # jump to your 3D projects folder
3dprint # run the full pipeline
3dinfo # build and describe the model
Checkpoints
- After step 3 you can determine whether a program will be found by
PATH.
Quiz - Lesson PS.4
- How do you print an environment variable?
- What is the purpose of
PATH? - How do you check whether
openscadis available? - How do you create a temporary alias?
- Where would you make an alias permanent?
- True or False: Environment variables are case-sensitive on all platforms.
- Explain why having a program in your PATH is useful compared to always using its full file path.
- Write a command that would create an alias called
slicerfor the OpenSCAD executable. - What file would you edit to make an alias persist across PowerShell sessions?
- Describe a practical benefit of using the
$env:TEMPdirectory for temporary files in a 3D printing workflow. - You have a custom script at
C:\Scripts\backup_models.ps1that you want to run from anywhere asbackup-now. What steps would you take to make this work? - Explain the difference between setting an environment variable in the current session vs. adding it to your profile for permanence.
- Design a profile strategy for managing multiple 3D printing projects, each with different tool paths and directories; show how to structure environment variables for each.
- If a program is not found by
Get-Command, what are the possible reasons, and how would you troubleshoot? - Describe how you would verify that your PowerShell profile is loading correctly and how to debug issues if aliases or environment variables don’t appear after restarting PowerShell.
Extension Problems
- Add a folder to PATH for a test program (describe steps; do not change system PATH without admin).
- Create a short profile snippet that sets two aliases and test re-opening PowerShell.
- Use
Get-Commandto list the path for several common programs. - Explore
$env:TEMPand create a file there. - Save a copy of your current PATH to a text file and examine it in your editor.
- Create a PowerShell profile script that loads custom aliases and environment variables for your 3D printing workflow; test it in a new session.
- Build a “project profile” that sets environment variables for CAD, slicing, and print directories; switch between profiles for different projects.
- Write a script that audits your current environment variables and creates a summary report of what’s set and why.
- Design a custom alias system for common 3D printing commands; document the aliases and their purposes.
- Create a profile migration guide: document how to export and import your PowerShell profile across machines for consistent workflows.
- Implement a safe PATH modification script: create a utility that allows you to add/remove directories from PATH for the current session only; show how to make it permanent in your profile.
- Build a comprehensive profile framework with modules: create separate .ps1 files for aliases, environment variables, and functions; have your main profile load all of them dynamically.
- Develop an environment validation tool: write a script that checks whether all required programs (OpenSCAD, slicers, etc.) are accessible via PATH; report findings and suggest fixes.
- Create a project-switching alias system: design a function that changes all environment variables and aliases based on the current project; test switching between multiple projects.
- Build a profile troubleshooting guide: create a script that exports your current environment state (variables, aliases, PATH) to a timestamped file, allowing you to compare states before and after changes and identify what broke.
References
- Microsoft. (2024). Environment variables in PowerShell. https://learn.microsoft.com/powershell/scripting/learn/shell/using-environment-variables
- Microsoft. (2024). Set-Alias cmdlet reference. https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/set-alias
- Microsoft. (2024). Creating and using PowerShell profiles. https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles
Helpful Resources
- Environment Variables in PowerShell
- Understanding the PATH Variable
- Set-Alias Cmdlet Reference
- Creating a PowerShell Profile
- Get-Command for Locating Programs
Lesson 5: Filling in the Gaps — Profiles and History
Estimated time: 30-45 minutes
Learning Objectives
- Use history and abort commands (
history,Ctrl+C) - Inspect and edit your PowerShell profile for persistent settings
- Run programs by full path using the
&operator - Handle common screen reader edge cases when using the terminal
Materials
- PowerShell and an editor (Notepad/ VS Code)
Step-by-step Tasks
- Run several simple commands (e.g.,
pwd,ls -n,echo hi) then runhistoryto view them. - Use
Invoke-History <n>to re-run a previous command (replace<n>with a history number). - Practice aborting a long-running command with
Ctrl + C(for example,ping 8.8.8.8). - Open your profile:
notepad.exe $PROFILE; if it doesn’t exist, create it:ni $PROFILE -Force. - Add a persistent alias line to your profile (example:
Set-Alias -Name preview -Value openscad), save, and reopen PowerShell to verify.
Checkpoints
- After step 2 you can re-run a recent command by history number.
- After step 5 your alias should persist across sessions.
Quiz - Lesson PS.5
- How do you view the command history?
- Which key combination aborts a running command?
- What does
echo $PROFILEshow? - How does the
&operator help run executables? - What is one strategy if terminal output stops being announced by your screen reader?
- True or False: Using
Ctrl+Cpermanently deletes any files created by the command you abort. - Explain the difference between
historyandGet-Historyin PowerShell. - If you place code in your profile but it doesn’t take effect after opening a new PowerShell window, what should you verify?
- Write a command that would run a program at the path
C:\Program Files\OpenSCAD\openscad.exedirectly. - Describe a practical workflow scenario where having keyboard shortcuts (aliases) in your profile would save time.
- Explain how to re-run the 5th command from your history, and what would happen if that command had file operations (creates/deletes).
- Design a profile initialization strategy that separates utilities for different projects; explain how you would switch between them.
- Walk through a troubleshooting workflow: your screen reader stops announcing output after running a long command. What steps would you take to diagnose and resolve the issue?
Caution
Before any destructive operation — mass delete, bulk overwrite, or recursive removal — use history review (
Get-History) and dry-run techniques (e.g.,What-If) to verify the command is correct. A single mistaken path in a bulk delete can be unrecoverable.
- Create a safety checkpoint system: before any destructive operation (mass delete, overwrite), how would you use profile functions and history to verify the command is correct?
- Develop a comprehensive capstone scenario: integrate everything from Lessons 0–5 (navigation, file operations, piping, environment setup, history) to design an automated 3D printing project workflow with error handling and logging.
Extension Problems
- Add an alias and an environment variable change to your profile and document the behavior after reopening PowerShell.
- Create a short script that automates creating a project folder and an initial .scad file.
- Experiment with running OpenSCAD by full path using
&and by placing it in PATH; compare results. - Practice redirecting
Get-Helpoutput to a file and reading it in Notepad for screen reader clarity. - Document three screen reader troubleshooting steps you used and when they helped.
- Build a comprehensive PowerShell profile that includes aliases, environment variables, and helper functions for your 3D printing workflow.
- Create a script that troubleshoots common PowerShell issues (module loading, permission errors, command not found); test at least three scenarios.
- Write a PowerShell function that coordinates multiple tasks: creates a project folder, starts OpenSCAD, and opens slicing software.
- Design a screen-reader accessibility guide for PowerShell: document commands, outputs, and accessible navigation patterns.
- Develop an advanced PowerShell workflow: implement error handling, logging, and confirmation prompts for risky operations.
- Implement a “undo” system using history: create a function that logs destructive commands (rm, mv, cp -Force) and allows you to review/rollback the last operation.
- Build a profile debugger: create a script that compares two PowerShell sessions’ environment states (variables, aliases, functions) to identify what loaded/failed to load.
- Develop a multi-project profile manager: design a system where you can switch entire environments (paths, aliases, variables) for different 3D printing projects by running a single command.
- Create a comprehensive accessibility analyzer: write a script that tests whether key PowerShell commands produce screen-reader-friendly output; document workarounds for commands that don’t.
- Design a complete capstone project: build an integrated automation suite that manages a 3D printing workflow (project setup, file organization, CAD/slicing tool automation, output logging, error recovery, and audit trails) with full error handling and documentation.
References
- Microsoft. (2024). PowerShell history and recall functionality. https://learn.microsoft.com/powershell/scripting/learn/shell/using-history
- Microsoft. (2024). Understanding and creating PowerShell profiles. https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles
- Microsoft. (2024). The call operator (&) for running executables. https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_operators#call-operator-
Helpful Resources
- PowerShell History and Recall
- Understanding Profiles
- Invoke-History Cmdlet Reference
- The Call Operator (&)
- Screen Reader Tips and Tricks
Lesson 6: Advanced Techniques — Scripts, Functions, and Professional Workflows
Duration: 4-4.5 hours (for screen reader users)
Prerequisites: Complete Lessons 0–5
Skill Level: Advanced intermediate
3DMake in Practice: Automating Your Print Workflow
Use PowerShell scripting to fully automate a 3DMake workflow across multiple projects:
# batch_print.ps1 - build and print every 3DMake project in a folder
param(
[string]$ProjectsDir = "$HOME\Documents\3d_projects"
)
Get-ChildItem -Path $ProjectsDir -Directory | ForEach-Object {
$project = $_.FullName
$name = $_.Name
Write-Host "Processing: $name"
Set-Location $project
# Build and slice; capture all output
$output = & 3dm build slice 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host " OK - sending to printer"
& 3dm print
} else {
Write-Host " FAILED - log saved to build_error.txt"
$output | Out-File "build_error.txt"
notepad.exe "build_error.txt"
}
}
Write-Host "Batch complete."
Save as batch_print.ps1 and run with .\batch_print.ps1. This script uses loops, conditionals, and piping — all from this lesson.
This lesson extends PowerShell skills to professional-level workflows. You’ll learn to automate complex tasks, write reusable code, and integrate tools for 3D printing workflows.
Learning Objectives
By the end of this lesson, you will be able to:
- Create and run PowerShell scripts (.ps1 files)
- Write functions that accept parameters
- Use loops to repeat tasks automatically
- Automate batch processing of 3D models
- Debug scripts when something goes wrong
- Create professional workflows combining multiple tools
PowerShell Scripts Basics
What’s a Script?
A script is a file containing PowerShell commands that run in sequence. Instead of typing commands one by one, you put them in a file and run them all at once.
Why use scripts?
- Repeatability: Run the same task 100 times identically
- Documentation: Commands are written down for reference
- Complexity: Combine many commands logically
- Automation: Schedule scripts to run automatically
Creating Your First Script
Step 1: Open a text editor
notepad.exe my-first-script.ps1
Step 2: Type this script
# This is a comment - screen readers will read it
Write-Output "Script is running!"
pwd
ls -n
Write-Output "Script is done!"
Step 3: Save the file
- In Notepad: Ctrl+S
- Make sure filename ends in
.ps1 - Save in an easy-to-find location (like Documents)
Step 4: Run the script
.\my-first-script.ps1
What happens: PowerShell runs each command in sequence and shows output.
Important: Script Execution Policy
Caution
If you get an “execution policy” error when running a
.ps1script, PowerShell’s security is blocking unsigned scripts. Use-Scope Processto bypass it only for the current session — this is safer than changing the policy machine-wide.
On some Windows systems, you might get an error about “execution policy”. This is a security feature.
To fix it temporarily:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
Then try your script again:
.\my-first-script.ps1
Note for screen readers: Your screen reader will announce the error if there is one. Use Get-Help Get-ExecutionPolicy for more information.
Variables and Parameters
Using Variables
Variables store values you want to use later.
Example script:
$mypath = "C:\Users\YourName\Documents"
cd $mypath
Write-Output "I am now in:"
pwd
ls -n
Breaking it down:
$mypath= variable name (always starts with$)== assign the value after this"C:\Users..."= the value (a path)cd $mypath= use the variable (replace$mypathwith its value)
Functions with Parameters
A function is reusable code that you can run with different inputs.
Example: A function that lists files in a folder
function ListFolder {
param(
[string]$path
)
Write-Output "Contents of: $path"
cd $path
ls -n
}
# Use the function:
ListFolder -path "C:\Users\YourName\Documents"
ListFolder -path "C:\Users\YourName\Downloads"
What’s happening:
function ListFolder= name of the functionparam([string]$path)= the function accepts a parameter called$path- Inside the function, use
$pathlike any variable - Call the function with
-path "value"
Screen reader tip: When you call a function, PowerShell will announce the results just like any command.
Loops - Repeating Tasks
Loop Over Files
Imagine you have 10 SCAD files and want to print their contents. You could do it 10 times manually, or use a loop.
Example: Print every .scad file in a folder
$scadFiles = ls -n *.scad
foreach ($file in $scadFiles) {
Write-Output "=== File: $file ==="
cat $file
Write-Output ""
}
What’s happening:
$scadFiles = ls -n *.scad= find all .scad files and store in variableforeach ($file in $scadFiles)= for each file, do this:Write-Output "=== File: $file ==="= announce which filecat $file= show contentsWrite-Output ""= blank line between files
Result: All files printed one after another, organized and readable.
Loop with a Counter
Example: Do something 5 times
for ($i = 1; $i -le 5; $i++) {
Write-Output "This is iteration number $i"
# Do something here
}
What’s happening:
for ($i = 1; $i -le 5; $i++)= loop from 1 to 5$i= counter variable (starts at 1, increases each loop)-le= “less than or equal to” (stop when $i > 5)$i++= add 1 to $i each time through
Real-World Example - Batch Processing SCAD Files
Scenario
You have 10 OpenSCAD (.scad) files in a folder. You want to:
- List them all
- Check how many there are
- For each one, verify it exists
The Script
# Batch Processing Script for SCAD Files
$scadFolder = "C:\Users\YourName\Documents\3D_Projects"
$scadFiles = ls $scadFolder -Filter *.scad -Name
Write-Output "Processing SCAD files in: $scadFolder"
Write-Output "Found $($scadFiles.Count) files"
Write-Output ""
foreach ($file in $scadFiles) {
$fullPath = Join-Path -Path $scadFolder -ChildPath $file
if (Test-Path -Path $fullPath) {
Write-Output " Found: $file"
} else {
Write-Output " Missing: $file"
}
}
Write-Output ""
Write-Output "Batch processing complete!"
Breaking it down:
$scadFolder= where to lookls $scadFolder -Filter *.scad -Name= find .scad files, show names onlyforeach= process each fileJoin-Path= combine folder and filename into full pathTest-Path= check if file existsif= do different things based on condition
Running the Script
- Save as
batch-process.ps1 - Edit
$scadFolderto match your real folder - Run it:
.\batch-process.ps1
Screen reader output:
Processing SCAD files in: C:\Users\YourName\Documents\3D_Projects
Found 10 files
Found: model1.scad
Found: model2.scad
Found: model3.scad
[... more files ...]
Batch processing complete!
Error Handling
Try-Catch Blocks
What if something goes wrong? Use try-catch:
Example:
try {
$file = "C:\nonexistent\path\file.txt"
$content = cat $file
Write-Output $content
} catch {
Write-Output "Error: Could not read file"
Write-Output "Details: $_"
}
What’s happening:
try= run these commands- If an error happens, PowerShell jumps to
catch catch= handle the error gracefully$_= the error message
Screen reader advantage: Errors are announced clearly instead of crashing silently.
Validating Input
Example: Make sure a folder exists before processing
function ProcessFolder {
param([string]$folderPath)
if (-not (Test-Path -Path $folderPath)) {
Write-Output "Error: Folder does not exist: $folderPath"
return
}
Write-Output "Processing folder: $folderPath"
ls -n $folderPath
}
ProcessFolder -folderPath "C:\Users\YourName\Documents"
What’s happening:
Test-Path= check if folder exists-not= if NOT truereturn= exit the function early if error
Debugging Scripts
Common Errors and Solutions
Error 1: “Command not found”
Cause: Typo in command name
Fix: Check spelling
# Wrong:
writ-output "hello"
# Correct:
Write-Output "hello"
Error 2: “Variable is null”
Cause: Variable was never assigned
Fix: Make sure variable is set before using it
$myvar = "hello" # Set first
Write-Output $myvar # Then use
Error 3: “Cannot find path”
Cause: Wrong folder path
Fix: Verify path exists
# Check if path exists:
Test-Path -Path "C:\Users\YourName\Documents"
# If false, the path is wrong
Warning
“Access denied” means PowerShell doesn’t have permission to perform the operation. Always understand why you need administrator privileges before elevating — running everything as admin creates unnecessary security risk.
Error 4: “Access denied”
Cause: Don’t have permission
Fix: Run PowerShell as administrator
- Right-click PowerShell -> Run as administrator
Debugging Technique: Trace Output
Add Write-Output statements to track what’s happening:
$path = "C:\Users\YourName\Documents"
Write-Output "Starting script. Path is: $path"
$files = ls -n $path
Write-Output "Found $($files.Count) files"
foreach ($file in $files) {
Write-Output "Processing: $file"
# Do something with $file
Write-Output "Done with: $file"
}
Write-Output "Script complete"
Your screen reader will announce each step, so you know where errors happen.
Creating Professional Workflows
Example 1: Automated Project Setup
Scenario: You start a new 3D printing project regularly. Instead of creating folders manually:
function SetupNewProject {
param([string]$projectName)
$baseFolder = "C:\Users\YourName\Documents\3D_Projects"
$projectFolder = Join-Path -Path $baseFolder -ChildPath $projectName
# Create folder structure
mkdir $projectFolder -Force
mkdir "$projectFolder\designs" -Force
mkdir "$projectFolder\output" -Force
mkdir "$projectFolder\notes" -Force
# Create a README
$readmeContent = @"
# $projectName
Created: $(Get-Date)
## Designs
All .scad files go here.
## Output
STL and other exports go here.
## Notes
Project notes and observations.
"@
$readmeContent | Out-File -FilePath "$projectFolder\README.txt" -Encoding utf8
Write-Output "Project setup complete: $projectFolder"
}
# Use it:
SetupNewProject -projectName "MyKeychain"
SetupNewProject -projectName "PhoneStand"
What it does:
- Creates folder structure for a new project
- Sets up subfolders for designs, output, notes
- Creates a README file automatically
Example 2: Batch File Verification
Scenario: Before processing, verify all required files exist:
function VerifyProjectFiles {
param([string]$projectFolder)
$requiredFiles = @(
"README.txt",
"designs",
"output",
"notes"
)
$allGood = $true
foreach ($item in $requiredFiles) {
$path = Join-Path -Path $projectFolder -ChildPath $item
if (Test-Path -Path $path) {
Write-Output " Found: $item"
} else {
Write-Output " Missing: $item"
$allGood = $false
}
}
if ($allGood) {
Write-Output "All checks passed!"
return $true
} else {
Write-Output "Some files are missing!"
return $false
}
}
# Use it:
$verified = VerifyProjectFiles -projectFolder "C:\Users\YourName\Documents\3D_Projects\MyKeychain"
if ($verified) {
Write-Output "Safe to proceed with processing"
}
Screen Reader Tips for Scripts
Making Script Output Readable
Problem: Script runs but output scrolls too fast or is hard to follow
Solution 1: Save to file
.\my-script.ps1 > output.txt
notepad.exe output.txt
Solution 2: Use Write-Output with clear sections
Write-Output "========== STARTING =========="
Write-Output ""
# ... script ...
Write-Output ""
Write-Output "========== COMPLETE =========="
Solution 3: Pause between major sections
Write-Output "Pausing... Press Enter to continue"
Read-Host
Your screen reader will announce the pause, give you time to read output.
Announcing Progress
For long-running scripts:
$files = ls -n *.scad
$count = 0
foreach ($file in $files) {
$count++
Write-Output "Processing $count of $($files.Count): $file"
# Do something with $file
}
Write-Output "All $count files processed!"
Practice Exercises
Exercise 1: Your First Script
Goal: Create and run a simple script
Steps:
- Create file:
notepad.exe hello.ps1 - Type:
Write-Output "Hello from my first PowerShell script!" pwd ls -n - Save and run:
.\hello.ps1
Checkpoint: You should see output for each command.
Exercise 2: Script with a Variable
Goal: Use a variable to make the script flexible
Steps:
- Create file:
notepad.exe smart-listing.ps1 - Type:
$targetFolder = "C:\Users\YourName\Documents" Write-Output "Listing contents of: $targetFolder" ls -n $targetFolder - Edit
$targetFolderto a real folder on your computer - Run:
.\smart-listing.ps1
Checkpoint: You should see listing of that specific folder.
Exercise 3: Function
Goal: Create a reusable function
Steps:
- Create file:
notepad.exe navigate.ps1 - Type:
function GoTo { param([string]$path) if (Test-Path -Path $path) { cd $path Write-Output "Now in: $(pwd)" Write-Output "Contents:" ls -n } else { Write-Output "Path does not exist: $path" } } # Test the function: GoTo -path "C:\Users\YourName\Documents" GoTo -path "C:\Users\YourName\Downloads" - Run:
.\navigate.ps1
Checkpoint: Both commands should work, showing contents of each folder.
Exercise 4: Loop
Goal: Use a loop to repeat an action
Steps:
- Create file:
notepad.exe repeat.ps1 - Type:
Write-Output "Demonstrating a loop:" for ($i = 1; $i -le 5; $i++) { Write-Output "Iteration $i: Hello!" } Write-Output "Loop complete!" - Run:
.\repeat.ps1
Checkpoint: Should print “Iteration 1” through “Iteration 5”.
Exercise 5: Real-World Script
Goal: Create a useful script for a real task
Steps:
- Create a folder:
mkdir C:\Users\YourName\Documents\TestFiles - Create some test files:
echo "test" > C:\Users\YourName\Documents\TestFiles\file1.txt echo "test" > C:\Users\YourName\Documents\TestFiles\file2.txt echo "test" > C:\Users\YourName\Documents\TestFiles\file3.txt - Create script:
notepad.exe report.ps1 - Type:
$folder = "C:\Users\YourName\Documents\TestFiles" $files = ls -n $folder Write-Output "=== FILE REPORT ===" Write-Output "Folder: $folder" Write-Output "Total files: $($files.Count)" Write-Output "" Write-Output "Files:" foreach ($file in $files) { Write-Output " - $file" } Write-Output "" Write-Output "=== END REPORT ===" - Run:
.\report.ps1
Checkpoint: Should show report of all files in the test folder.
Quiz — Lesson 6
- What is a PowerShell script?
- What file extension do PowerShell scripts use?
- What is a variable and how do you create one?
- What is a function and why would you use one?
- How do you run a script?
- What is a loop and what does
foreachdo? - What does
Test-Pathdo? - How do you handle errors in a script?
- When would you use
Try-Catch? - What technique makes script output readable for screen readers?
Extension Problems
- Auto-Backup Script: Create a script that copies all files from one folder to another, announcing progress
- File Counter: Write a function that counts files by extension (.txt, .scad, .stl, etc.)
- Folder Cleaner: Script that deletes files older than 30 days (with user confirmation)
- Project Template: Function that creates a complete project folder structure with all needed files
- Batch Rename: Script that renames all files in a folder according to a pattern
- Log Generator: Create a script that records what it does to a log file for later review
- Scheduled Task: Set up a script to run automatically every day at a specific time
- File Verifier: Check that all SCAD files in a folder have corresponding STL exports
- Report Generator: Create a summary report of all projects in a folder
- Error Tracker: Script that lists all commands that had errors in your recent history
Important Notes
- Always test scripts on small sets of files first before running them on important data
- Save your work regularly - use version control if possible
- Test error handling - make sure errors don’t crash silently
- Document your scripts - use comments so you remember what each part does
- Backup before batch operations - if something goes wrong, you have the original
References
- Microsoft PowerShell Scripting Guide: https://docs.microsoft.com/powershell/scripting/
- Function Documentation: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_advanced
- Error Handling: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_error_handling
- Loops: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_foreach
Next Steps: After mastering this lesson, explore PowerShell modules, remoting, and 3D printing integration in the main curriculum.
Unit Exam — Comprehensive Assessment
Estimated time: 60-90 minutes
Key Learning Outcomes Assessed
By completing this unit test, you will demonstrate:
- Understanding of file system navigation and path concepts
- Proficiency with file and folder manipulation commands
- Ability to redirect and pipe command output
- Knowledge of environment variables and aliases
- Screen-reader accessibility best practices in terminal environments
- Problem-solving and command chaining skills
Target Audience:
Users who have completed Lessons 0–5 and need to demonstrate mastery of PowerShell fundamentals.
Instructions:
Complete all sections below. For multiple choice, select the best answer. For short answers, write one to two sentences. For hands-on tasks, capture evidence (screenshots or output files) and submit alongside your answers.
Part A: Multiple Choice Questions (20 questions)
Select the best answer for each question. Each question is worth 1 point.
-
What is the primary purpose of the
PATHenvironment variable?- A) Store your home directory location
- B) Tell the shell where to find executable programs
- C) Configure the visual appearance of the terminal
- D) Store the current working directory name
-
Which command prints your current working directory?
- A)
ls -n - B)
cd - C)
pwd - D)
whoami
- A)
-
What does the
~symbol represent in PowerShell paths?- A) The root directory
- B) The current directory
- C) The parent directory
- D) The home directory
-
How do you list only file names (not full details) in a way that is screen-reader friendly?
- A)
ls - B)
ls -n - C)
ls -l - D)
cat -n
- A)
-
Which command creates a new empty file?
- A)
mkdir filename - B)
ni filename - C)
touch filename - D)
echo filename
- A)
Important
>overwrites a file completely — all previous content is lost.>>appends to the end of a file, preserving existing content. Using>when you meant>>will permanently destroy the file’s previous contents.
-
What is the difference between
>and>>?- A)
>redirects to file,>>displays on screen - B)
>overwrites a file,>>appends to a file - C) They do the same thing
- D)
>is for text,>>is for binary
- A)
-
What does the pipe operator
|do?- A) Creates a folder
- B) Sends the output of one command to the input of another
- C) Deletes files matching a pattern
- D) Lists all processes
-
Which command copies a file?
- A)
mv - B)
rm - C)
cp - D)
cd
- A)
-
How do you rename a file from
oldname.txttonewname.txt?- A)
cp oldname.txt newname.txt - B)
mv oldname.txt newname.txt - C)
rename oldname.txt newname.txt - D)
rn oldname.txt newname.txt
- A)
-
What is the purpose of
Select-String?- A) Select files in a directory
- B) Search for text patterns within a file
- C) Select a string to copy to clipboard
- D) Select which shell to use
-
Which key combination allows you to autocomplete a path in PowerShell?
- A)
Ctrl + A - B)
Ctrl + E - C)
Tab - D)
Space
- A)
-
How do you copy text to the Windows clipboard from PowerShell?
- A)
cat filename > clipboard - B)
cat filename | clip - C)
copy filename - D)
cat filename | paste
- A)
-
What does
Get-Command openscaddo?- A) Opens the OpenSCAD application
- B) Gets help about the OpenSCAD command
- C) Locates the full path of the openscad executable
- D) Lists all available commands
-
Which wildcard matches any single character?
- A)
* - B)
? - C)
% - D)
#
- A)
-
What is the purpose of the
&call operator?- A) Run a script or executable by full path
- B) Execute all commands in parallel
- C) Combine multiple commands
- D) Create an alias
-
How do you create a temporary alias for a command?
- A)
alias preview='openscad' - B)
Set-Alias -Name preview -Value openscad - C)
New-Alias preview openscad - D)
Alias preview = openscad
- A)
-
Where is your PowerShell profile typically stored?
- A) C:\Program Files\PowerShell\profile.ps1
- B) The location returned by
echo $PROFILE - C) ~/PowerShell/profile.ps1
- D) ~/.bashrc
-
How do you abort a long-running command in PowerShell?
- A) Press
Escape - B) Press
Ctrl + X - C) Press
Ctrl + C - D) Press
Alt + F4
- A) Press
-
What command shows the history of previously run commands?
- A)
history - B)
Get-History - C)
Show-History - D) Both A and B
- A)
-
How do you permanently set an alias so it persists across PowerShell sessions?
- A) Use
Set-Aliasin the terminal every time - B) Add the
Set-Aliasline to your PowerShell profile - C) Use the Windows Control Panel
- D) Aliases cannot be made permanent
- A) Use
Part B: Short Answer Questions (10 questions)
Answer each question in one to two sentences. Each question is worth 2 points.
-
Explain the difference between absolute and relative paths. Give one example of each.
-
Why is
ls -npreferred overlsfor screen reader users? Describe what flag you would use to list only files. -
What is the purpose of redirecting output to a file, and give an example of when you would use
>instead of>>?
Warning
rm -r ~/Documents/my_folderpermanently deletes the folder and everything inside it — all files, all subdirectories — with no confirmation and no undo. Always verify the path withls -1first and consider making a backup withcp -rbefore running recursive deletions.
-
Describe what would happen if you ran
rm -r ~/Documents/my_folderand why this command should be used carefully. -
How would you search for all files with a
.scadextension in your current directory? Write the command. -
Explain what happens when you pipe the output of
ls -nintoclip. What would you do next? -
What is an environment variable, and give one example of how you might use it in PowerShell.
-
If a program is not in your
PATH, what two methods could you use to run it from PowerShell? -
Describe how you would open a file in Notepad and also add a line to it from PowerShell.
-
What is one strategy you would use if your screen reader stops announcing terminal output while using PowerShell?
Part C: Hands-On Tasks (10 tasks)
Complete each task and capture evidence (screenshots, output files, or command transcripts). Each task is worth 3 points.
Tasks 1-5: File System and Navigation
-
Create a folder structure
~/Documents/PowerShell_Assessment/Projectsusing a single command. Capture thels -noutput showing the creation. -
Create five files named
project_1.scad,project_2.scad,project_3.txt,notes_1.txt, andnotes_2.txtinside theProjectsfolder. Use wildcards to list only.scadfiles, then capture the output. -
Copy the entire
Projectsfolder toProjects_Backupusingcp -r. Capture thels -noutput showing both folders exist. -
Move (rename)
project_1.scadtoproject_1_final.scad. Capture thels -noutput showing the renamed file. -
Delete
notes_1.txtandnotes_2.txtusing a singlermcommand with wildcards. Capture the finalls -noutput.
Tasks 6-10: Advanced Operations and Scripting
-
Create a file called
my_data.txtwith at least four lines usingechoand>>. Then read it withcat my_data.txtand capture the output. -
Use
Select-Stringto search for a keyword (e.g., “project”) inmy_data.txtand pipe the results toclip. Paste the results into Notepad and capture a screenshot. -
List all files in the
Projectsfolder and redirect the output toprojects_list.txt. Open it in Notepad and capture a screenshot of the file. -
Create a temporary alias called
mylsthat runsls -n, test it, and capture the output. Then explain what would be required to make it permanent. -
Run
Get-Help Get-ChildItemand redirect the output tohelp_output.txt. Open the file in Notepad and capture a screenshot showing at least the first page of help content.
Grading Rubric
| Section | Questions | Points Each | Total |
|---|---|---|---|
| Multiple Choice | 20 | 1 | 20 |
| Short Answer | 10 | 2 | 20 |
| Hands-On Tasks | 10 | 3 | 30 |
| Total | 40 | - | 70 |
Passing Score: 49 points (70%)
Helpful Resources for Review
- PowerShell Command Reference
- Navigation and File System
- Using Pipes and Filtering
- Profile and Aliases
- Screen Reader Accessibility Tips
Submission Checklist
- All 20 multiple choice questions answered
- All 10 short answer questions answered (1-2 sentences each)
- All 10 hands-on tasks completed with evidence captured
- Files/screenshots organized and labeled clearly
- Submission includes this checklist
Part 2 — Windows Command Prompt (CMD)
Last Updated: February 2026
Total Duration: 30–45 hours of instruction and practice (for screen reader users)
Target Users: Anyone using a screen reader — NVDA, JAWS, Windows Narrator, and Dolphin SuperNova are all covered throughout this curriculum.
Alternate to: PowerShell curriculum (same concepts, CMD syntax)
This single file contains the complete CMD Foundation curriculum in reading order. All lessons, quizzes, extension problems, and the unit exam are included. No additional files are needed.
Table of Contents
| Section | Title | Estimated Time |
|---|---|---|
| Screen Reader Accessibility Guide | NVDA, JAWS, Narrator, and SuperNova reference for CMD | 1.5 hours |
| Lesson Pre: Your First Terminal | Opening CMD, first commands, basic navigation | 1.5–2 hours |
| Lesson 0: Getting Started | Paths, shortcuts, tab completion | 1.5 hours |
| Lesson 1: Navigation | Moving around the file system confidently | 2–2.5 hours |
| Lesson 2: File and Folder Manipulation | Create, copy, move, delete files and folders | 2.5–3 hours |
| Lesson 3: Input, Output, and Piping | Redirect output, chain commands with pipes | 2.5–3 hours |
| Lesson 4: Environment Variables and Aliases | Automate settings, create doskey shortcuts | 2–2.5 hours |
| Lesson 5: Filling in the Gaps | Autorun scripts, history, debugging | 2–2.5 hours |
| Lesson 6: Advanced Techniques | Batch scripts, subroutines, loops, professional workflows | 4–4.5 hours |
| Unit Exam | Comprehensive assessment — Lessons 0 through 6 | 60–90 minutes |
Total: approximately 30–45 hours including practice exercises
How to Use This File
If you have never used a terminal before: read from the top in order. Do not skip lessons — each builds on the one before it.
If you have used a terminal but not with a screen reader: start with the Accessibility Guide, skim Lesson Pre, then continue from Lesson 0.
If you are experienced with both: jump directly to the lesson you need. Use the quiz at the end of each lesson to self-test before moving on.
Reference while working: the Accessibility Guide contains material you will return to throughout the curriculum. Keep a copy open or bookmark that section.
PowerShell users: this curriculum covers the same concepts as the PowerShell curriculum but uses CMD syntax. The two curricula are interchangeable as learning paths — choose one and stay consistent.
Curriculum Rules (Read These First)
Important
Rule 1 — Always know where you are. Start every session with
cd(no arguments) to print your current location. If you don’t know your path, you will get lost and may operate on the wrong files.
Rule 1 — Always know where you are.
Every session, first thing: cd (with no arguments). If you do not know your path, you will get lost.
Warning
Files deleted from CMD do not go to the Recycle Bin. They are permanently gone immediately. Always run
dir /Bto confirm exactly what you are about to delete before runningdelorrmdir /S.
Rule 2 — Check before you delete.
Before any del or rmdir command: dir /B to confirm exactly what you are about to remove. Deleted files do not go to the Recycle Bin from CMD.
Tip
Always use
dir /B— never baredir. The/B(bare) flag outputs one name per line, which screen readers can follow reliably. Barediroutputs multi-column details that can be difficult to navigate audibly.
Rule 3 — Use dir /B for listings.
Always dir /B — never bare dir. The /B flag gives one name per line, which all screen readers can follow reliably.
Tip
When terminal output is confusing or overwhelming, redirect it to a file:
command > output.txt, then open it withnotepad.exe output.txt. This is clearer than reading raw terminal output and works with all four screen readers.
Rule 4 — When output is confusing, redirect to a file.command > output.txt then notepad.exe output.txt. This works with all four screen readers.
Rule 5 — Save everything you create.
Keep all practice files in a dedicated learning folder: mkdir %USERPROFILE%\CMD_Learning
Screen Reader Accessibility Guide
Target Users: NVDA, JAWS, and other screen reader users
Last Updated: 2026
This guide supports the CMD Foundation curriculum and helps screen reader users navigate and work efficiently with the Windows Command Prompt.
Table of Contents
- Getting Started with Screen Readers
- NVDA-Specific Tips
- JAWS-Specific Tips
- General Terminal Accessibility
- Working with Long Output
- Keyboard Shortcuts Reference
- Troubleshooting
Getting Started with Screen Readers
Which Screen Reader Should I Use?
Both NVDA and JAWS work with CMD; NVDA is free and often easiest to start with. JAWS provides advanced features for power users. Dolphin SuperNova and Windows Narrator are also options:
- Dolphin SuperNova: commercial speech, braille, and magnification (use vendor docs for key mappings).
- Windows Narrator: built into Windows for quick, no-install access.
Before You Start
- Start your screen reader before opening CMD.
- Open Command Prompt and listen for the window title and prompt.
- If silent, press Alt+Tab to find the window.
What is CMD?
CMD (Command Prompt) is the classic Windows shell. Common commands include dir, type, and more. Paths use backslashes (e.g., C:\Users\You).
NVDA-Specific Tips
NVDA is available from https://www.nvaccess.org/
Dolphin SuperNova
Dolphin SuperNova: https://yourdolphin.com/supernova/ — commercial screen reader and magnifier; check institutional licensing.
Windows Narrator
Windows Narrator: https://support.microsoft.com/narrator — built-in, simpler command set; useful when third-party readers are unavailable.
Key Commands for CMD
| Command | What It Does |
|---|---|
| NVDA+Home | Read the current line (your command or output) |
| NVDA+Down Arrow | Read from cursor to end of screen |
| NVDA+Up Arrow | Read from top to cursor |
| NVDA+Page Down | Read next page |
| NVDA+Page Up | Read previous page |
| NVDA+F7 | Open the Review Mode viewer (can scroll through text) |
Example: Reading Long Output
If dir produces many lines, redirect to a file and open it in Notepad:
dir /b > list.txt
notepad list.txt
dir /b shows one item per line (screen reader friendly).
JAWS-Specific Tips
JAWS is available from https://www.freedomscientific.com/
Key Commands for CMD
| Command | What It Does |
|---|---|
| Insert+Down Arrow | Read line by line downward |
| Insert+Up Arrow | Read line by line upward |
| Insert+Page Down | Read next page of text |
| Insert+Page Up | Read previous page of text |
Example: Reading Long Output
- Redirect:
dir /b > list.txt - Open Notepad:
notepad list.txt - Use Insert+Ctrl+Down to read full contents.
General Terminal Accessibility
Understanding the CMD Layout
The Command Prompt window shows a title bar, a content area, and the prompt (e.g., C:\Users\YourName>).
The CMD Prompt
Example:
C:\Users\YourName>
Navigation Sequence
- Screen reader announces the title
- Then it announces the prompt line
- Anything above prompt is prior output
Working with Long Output
Solution 1: Redirect to a File
dir /b > list.txt
notepad list.txt
Solution 2: Use Pagination
type largefile.txt | more
Use Space for next page and Q to quit.
Solution 3: Filter Output
dir /b | findstr /R "\.scad$"
Solution 4: Count Before Displaying
dir /b | find /v "" /c
Keyboard Shortcuts Reference
| Key | Action |
|---|---|
| Up Arrow | Show previous command |
| Down Arrow | Show next command |
| Tab | Auto-complete file/folder names |
| Home | Jump to start of line |
| End | Jump to end of line |
| Ctrl+C | Stop command |
| Enter | Run command |
Troubleshooting
Problem: “I Can’t Hear the Output”
- Redirect to file and open in Notepad.
- Use End to jump to the end of text.
Problem: “Tab Completion Isn’t Working”
- Type at least one character before Tab.
Problem: “Command Not Found”
- Use
where programnameto find installed programs.
Pro Tips
- Use
dir /bfor one-per-line listings. - Create a personal notes file and open it in Notepad for quick reference.
Recommended Workflow
cdto the project folderdir /bto list files- Redirect large output to files and open in Notepad
Additional Resources
- NVDA Documentation: https://www.nvaccess.org/documentation/
- JAWS Documentation: https://www.freedomscientific.com/support/
- Windows CMD Reference: https://docs.microsoft.com/windows-server/administration/windows-commands/windows-commands
- NVDA Documentation: https://www.nvaccess.org/documentation/
- JAWS Documentation: https://www.freedomscientific.com/support/
- Dolphin SuperNova: https://yourdolphin.com/supernova/
- Windows Narrator: https://support.microsoft.com/narrator
Lesson Pre: Your First Terminal — Screen Reader Navigation Fundamentals
Duration: 1.5-2 hours (for screen reader users)
Prerequisites: None — this is the starting point
Accessibility Note: This lesson is designed specifically for screen reader users. Tips are provided for NVDA, JAWS, Windows Narrator, and Dolphin SuperNova.
What is a Terminal?
A terminal (also called command line or Command Prompt) is a text-based interface where you type commands instead of clicking buttons. Think of it like sending written instructions to your computer instead of pointing and clicking.
Why learn this?
- Faster and more precise work, especially for 3D printing scripts and automation.
- Essential for using tools like OpenSCAD.
- Accessibility: command-line tools work reliably with screen readers — output is plain text.
- Simple automation without complex graphical interfaces.
Opening Command Prompt for the First Time
3DMake: Your First Real-World Goal
3DMake (github.com/tdeck/3dmake) is a free, accessibility-first command-line tool for designing and 3D-printing models entirely from the terminal — no mouse required. Every CMD skill in this curriculum directly supports a real 3DMake workflow.
Here is the end goal — one command that builds your OpenSCAD model, slices it, and sends it to the printer:
REM Navigate to your project folder
cd %USERPROFILE%\Documents\3d_projects\my_cube
REM Build, slice, and print in a single command
3dm build slice print
Keep this goal in mind as you work through each lesson.
Opening Command Prompt for the First Time
Method 1: Search (Easiest)
- Press the Windows key alone.
- Type:
cmd - You will hear search results appear.
- Press Enter to open the first result (Command Prompt).
Method 2: Using the Run Dialog
- Press Windows key + R (opens the Run dialog).
- Type:
cmd - Press Enter.
Method 3: From the Start Menu
- Press the Windows key.
- Navigate to Windows System or Windows Tools (depending on your Windows version).
- Open Command Prompt.
First Connection: Understanding the Prompt
When Command Prompt opens, your screen reader will announce the window title and then the prompt. The prompt is where you type commands.
What you will hear:
C:\Users\YourName>
What this means:
C:\Users\YourName= Your current location (the path).>= The prompt is ready for input.
Your cursor is right after the >. This is where you type.
Your First Commands (Screen Reader Edition)
Command 1: “Where Am I?” — cd
Running cd with no arguments shows your current directory.
Type this and press Enter:
cd
What you will hear: Your screen reader announces the current path, for example:
C:\Users\YourName
Understanding paths:
- A path shows your location in the file system, like a mailing address.
- Windows paths use backslashes:
C:\Users\YourName\Documents - Think of it as nested folders:
C:\(the main drive) >Users>YourName>Documents
Command 2: “What’s Here?” — dir
Type this and press Enter:
dir /B
What you will hear:
Your screen reader announces folder and file names, one per line. The /B flag gives a clean “bare” listing — names only, no dates or sizes — which is much easier to follow with a screen reader.
If you want more detail (sizes, dates), run dir without /B. But for navigation, dir /B is preferred.
Command 3: “Go There” — cd Documents
Type this and press Enter:
cd Documents
What you will hear: The prompt changes to show your new location:
C:\Users\YourName\Documents>
Practice navigation:
- Run
cdto confirm you are in Documents. - Run
dir /Bto see what is there. - Go back up:
cd ..(the..means “go up one level”). - Run
cdagain to confirm. - Return to Documents:
cd Documents
Reading Screen Reader Output (Critical Skills)
Dealing with Long Lists
When you run dir in a folder with many files, the list may be very long. Here is how to manage it:
Solution 1: Save to a File
dir /B > list.txt
notepad.exe list.txt
This saves the listing to a file and opens it in Notepad, where you can read it calmly with your screen reader.
Solution 2: Use Pause
dir /B | more
Shows output one page at a time. Press Space to go to the next page, Q to quit. Note: some screen readers read more output less reliably than a saved file — if this is difficult, use Solution 1.
Tab Completion
Tab completion is one of the most powerful screen reader techniques in the terminal.
How it works:
- Type the first few letters of a folder or file name.
- Press Tab.
- Command Prompt automatically completes the rest.
Example:
- You are at
C:\Users\YourName> - Type:
cd Doc - Press Tab
- Command Prompt completes it to:
cd Documents - Press Enter to navigate there.
With a screen reader, when you press Tab the screen reader announces the completed command — much faster and more accurate than typing the whole thing.
Creating and Viewing Files
Create a Simple File
echo Hello, Command Prompt! > hello.txt
echooutputs text.>redirects it to a file calledhello.txt.
Read the File Back
type hello.txt
Your screen reader announces the file contents.
Open and Edit the File
notepad.exe hello.txt
Opens the file in Notepad for comfortable editing with your screen reader.
Essential Keyboard Shortcuts
| Key Combination | What It Does |
|---|---|
| Up Arrow | Shows your previous command (press again for earlier commands) |
| Down Arrow | Shows a more recent command in history |
| Tab | Auto-completes folder and file names |
| Ctrl+C | Stops a running command |
| cls | Clears the screen (type this and press Enter) |
| Enter | Runs the command you have typed |
| Home | Moves cursor to start of command line |
| End | Moves cursor to end of command line |
Screen Reader-Specific Tips
NVDA Users
NVDA is available free from https://www.nvaccess.org/
- After running a command, press NVDA+Home (Insert+Home or CapsLock+Home) to read the current line.
- To read all output, press NVDA+Down Arrow to read from the cursor to the end of the screen.
- To browse previous output, use the NVDA review cursor: press Numpad 8/2 (desktop) or the equivalent laptop keys to move up and down through lines.
- If output scrolled past, redirect to a file:
command > output.txt, thennotepad.exe output.txt. - To open NVDA settings: press NVDA+N (opens NVDA menu), then go to Preferences.
NVDA key note: The NVDA modifier key is Insert by default on desktops. On laptops it is often CapsLock. Check your NVDA settings if these shortcuts do not work as described.
JAWS Users
JAWS is available from https://www.freedomscientific.com/products/software/jaws/
- After running a command, press Insert+Up Arrow to re-read the current line.
- To read all output, press Insert+Ctrl+Down to read to the end of the screen.
- To move through output line by line, press Insert+Down Arrow repeatedly.
- If output is too long, redirect to a file:
command > output.txt, thennotepad.exe output.txt. - JAWS demo mode reminder: If you are using JAWS without a license, sessions are limited to approximately 40 minutes. Save your work and restart the session if JAWS stops responding.
JAWS key note: The JAWS modifier key is Insert by default. On some laptops it can be set to CapsLock in JAWS Settings Center.
Windows Narrator Users
Windows Narrator is built into Windows 10 and Windows 11. Enable it with Windows+Ctrl+Enter.
- After running a command, press Narrator+D (CapsLock+D or Insert+D) to read the current line.
- To read all output from here, press Narrator+R to read from the cursor position.
- To move through output, use Narrator+Up/Down Arrow in scan mode (press Narrator+Space to toggle scan mode on).
- For long outputs, always redirect to a file:
command > output.txt, thennotepad.exe output.txt. Notepad is more comfortable for Narrator users than reading directly from the terminal. - Narrator settings: Windows key > Settings > Accessibility > Narrator.
Narrator key note: The Narrator modifier key is CapsLock or Insert. You can change it in Settings > Accessibility > Narrator > Keyboard shortcuts.
Dolphin SuperNova Users
Dolphin SuperNova is available from https://yourdolphin.com/supernova/
- After running a command, press CapsLock+L to read the current line.
- To read all output, press CapsLock+Numpad Plus (say all from current position).
- To move through output, press CapsLock+Numpad 8 (up) and CapsLock+Numpad 2 (down) to move line by line through the review buffer.
- For long outputs, redirect to a file:
command > output.txt, thennotepad.exe output.txt. - SuperNova settings: press CapsLock+SpaceBar to open the SuperNova Control Panel.
Dolphin key note: The SuperNova modifier key is CapsLock by default. This can be changed in the SuperNova Control Panel > Keyboard.
Common Issue: “I Can’t Hear the Output”
This happens to everyone starting out. Here are the solutions:
- Make sure your screen reader was running before you opened Command Prompt. If not, close Command Prompt, confirm your screen reader is running, then reopen it.
- Press End to make sure your cursor is at the prompt.
- Redirect to a file:
command > output.txt, thennotepad.exe output.txt. This always works with all screen readers. - Use the screen reader’s review commands listed above to scan back through previous output.
Practice Exercises
Complete these in order. Take your time.
Exercise 1: Basic Navigation
- Open Command Prompt.
- Run
cdand note your location. - Run
dir /Band listen to the listing. - Type
cd Documentsand press Enter. - Run
cdto confirm your new location. - Run
dir /Bin this new location.
Goal: You know where you are and what is around you.
Exercise 2: Using Tab Completion
- In your home directory, type
cd D(just those two characters). - Press Tab.
- Command Prompt should auto-complete to a folder starting with D.
- Repeat with other folder names.
- Try
cd Downand Tab toDownloads.
Goal: Tab completion feels natural.
Exercise 3: Creating and Viewing Files
- Create a file:
echo Test content > test.txt - View it:
type test.txt - Create another:
echo Line 2 > another.txt - List both:
dir /B *.txt
Goal: You understand create, view, and list operations.
Exercise 4: Going Up Levels
- Navigate into several folders:
cd Documents, thencd folder1, etc. - From inside, run
cd ..multiple times to come back up. - After each
cd .., runcdto confirm your location.
Goal: You are comfortable with relative navigation using ..
Exercise 5: Redirecting Output
- Create a listing:
dir /B > directorylist.txt - Open it:
notepad.exe directorylist.txt - Read it with your screen reader.
- Close Notepad.
Goal: You can save long outputs to files for easier reading.
Checkpoint Questions
After this lesson, you should be able to answer all ten with confidence:
- What does
cddo with no arguments? - What does
dir /Bdo? - Why do we use
/Bwithdir? - What is your current path right now?
- How do you navigate to a new folder?
- How do you go up one level?
- What is the Tab key for?
- What does
echo text > file.txtdo? - How do you read a file back in the terminal?
- How do you stop a command that is running?
Answer all 10 before moving to Command Line Lesson 0.
Common Questions
Q: Should I use Command Prompt or PowerShell?
A: Command Prompt is simpler and a good starting point. PowerShell is more powerful. Both work well with all four screen readers covered in this curriculum. Start with whichever your curriculum pathway specifies.
Q: Why is my screen reader not reading the output?
A: This is common. Use command > file.txt to save output to a file, then open it with notepad.exe file.txt for reliable reading.
Q: What if I type something wrong?
A: Press Enter and you will see an error message. Type the correct command on the next line. No harm done.
Q: How do I get help with a command?
A: Type help command-name (for example, help cd). Or type command /? for built-in help (for example, dir /?).
Next Steps
Once comfortable with these basics, move to Command Line Lesson 0: Getting Started for deeper path understanding, then continue through Command Line Lesson 1 to Command Line Lesson 5 for full terminal mastery.
Troubleshooting
| Issue | Solution |
|---|---|
| Command Prompt won’t open | Press Windows+R, type cmd, press Enter |
| Cannot hear the output | Redirect to a file: command > output.txt, then notepad.exe output.txt |
| Tab completion not working | Type at least one character before pressing Tab |
| Command not found | Check spelling; try help for a list of available commands |
| Stuck in a command | Press Ctrl+C to stop it |
| JAWS stops working mid-session | If using JAWS demo: restart computer, demo sessions last ~40 minutes |
Resources
- NVDA: https://www.nvaccess.org/
- JAWS: https://www.freedomscientific.com/products/software/jaws/
- Windows Narrator guide: https://support.microsoft.com/narrator
- Dolphin SuperNova: https://yourdolphin.com/supernova/
- Windows CMD Reference: https://example.com
Lesson 0: Getting Started — Layout, Paths, and the Shell
Estimated time: 20-30 minutes
Learning Objectives
- Launch Command Prompt and locate the prompt
- Understand path notation and shortcuts (
C:\,..,.) - Use tab completion to navigate quickly
Materials
- Computer with Windows
- Editor (Notepad/VS Code)
Step-by-step Tasks
- Open Command Prompt and note the prompt (it includes the current path).
- Run
cdand say or note the printed path. - Use
dir /Bto list names in your home directory. - Practice
cd Documents,cd ..andcd \until comfortable. - Try tab-completion: type
cd Dand press Tab.
Checkpoints
- Confirm you can state your current path and move to
Documents.
3DMake Quick-Start: Your First Real Project
You now know enough CMD to set up a real 3DMake project. Do this now — it is the fastest path to a printed object.
Step 1 — Download and run the 3DMake setup wizard:
REM Go to your Downloads folder (where you extracted 3dmake_windows.zip)
cd %USERPROFILE%\Downloads\3dmake
REM Run the guided setup (answer the questions about your printer)
3dm setup
Step 2 — Create your first project:
REM Create a folder for all your 3D projects
mkdir %USERPROFILE%\Documents\3d_projects
REM Create your first project folder and initialize it
mkdir %USERPROFILE%\Documents\3d_projects\my_cube
cd %USERPROFILE%\Documents\3d_projects\my_cube
3dm new
Step 3 — Confirm the project structure:
REM You should see three items: src, build, and 3dmake.toml
dir /B
You just used mkdir, cd, and dir /B on a real project. You are ready to print.
Checkpoints
- Confirm you can state your current path and move to
Documents.
Quiz - Lesson CMD.0
- What is a path?
- What does
..mean? - How do you autocomplete a path?
- How do you go up one directory?
- What command lists only names (
dirflag)? - True or False: On Windows, CMD uses backslashes (
\) in paths, but forward slashes (/) are also accepted in some contexts. - Explain the difference between an absolute path and a relative path.
- If you are in
C:\Users\YourName\Documentsand you typecd .., where do you end up? - What happens when you press Tab while typing a folder name in Command Prompt?
- Describe a practical reason why understanding paths is important for a 3D printing workflow.
- What does
C:\mean in a path, and when would you use it? - If a folder path contains spaces (e.g.,
Program Files), how do you navigate to it withcd? - Explain what the prompt
C:\Users\YourName>tells you about your current state. - How would you navigate to your home directory from any location using a single command?
- What is the advantage of using relative paths (like
..) versus absolute paths in automation scripts?
Extension Problems
- Create a nested folder and practice
cdinto it by typing partial names and using Tab. - Use
dir /B /A:Fto list only files in a folder. - Save
cdoutput (the path) to a file and open it in Notepad. - Try
cdinto a folder whose name contains spaces; observe how quotes are handled. - Create a short note file and open it from Command Prompt.
- Build a folder structure that mirrors your project organization; navigate to each level and document the path.
- Use
echo %cd%to print your current path and save it to a file. - Investigate special paths (e.g.,
%USERPROFILE%,%TEMP%); write down what each contains and when you’d use them. - Compare absolute vs. relative paths by navigating to the same folder using each method; explain which is easier for automation.
- Create a batch file that changes to a frequently-used folder and lists its contents in one command; test it from different starting locations.
- Navigate to three different locations and at each one note the prompt, the path from
cd, and verify you understand what each shows. - Create a complex folder tree (at least 5 levels deep) and navigate it using only relative paths; verify your location at each step.
- Document all path shortcuts you know (
C:\,..,.) and demonstrate each one works as expected. - Write a guide for a peer on how to understand the Command Prompt and path notation without using GUI file explorer.
- Create a troubleshooting flowchart: if someone says “I don’t know where I am,” what commands do you give them to find out?
References
- Microsoft. (2024). Command line reference. https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/
- Microsoft. (2024). Using the cd command. https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cd_1
Helpful Resources
Lesson 1: Navigation — Moving Around Your File System
Duration: 1.5-2 hours (for screen reader users)
Prerequisites: Command Line Lesson Pre and Command Line Lesson 0
Learning Objectives:
- Navigate confidently to any folder location
- Understand and use relative versus absolute paths
- Use shortcuts to move between common folders
- Organize your file system logically
Core Navigation Commands
Command: cd (Change Directory)
cd FolderName :: Go into a folder
cd .. :: Go up one level
cd \ :: Go to root of current drive (e.g., C:\)
cd %USERPROFILE% :: Go to home directory
Command: dir /B (List Contents)
dir /B :: List all names (one per line, screen-reader friendly)
dir /B /A:D :: List only directories/folders
dir /B /A:F :: List only files
Command: Show Current Location
cd :: Running cd with no arguments shows current path
Understanding Paths
Absolute Paths (Full Address)
An absolute path starts from the root and shows the complete location:
C:\Users\YourName\Documents\3DPrinting
C:\— The C drive rootUsers— First folderYourName— Your user folderDocuments— Documents folder3DPrinting— Your 3D printing folder
Navigate there directly:
cd C:\Users\YourName\Documents\3DPrinting
Relative Paths (Directions From Here)
cd Documents\3DPrinting :: Go into Documents, then into 3DPrinting
cd .. :: Go up one level
cd ..\.. :: Go up two levels
Shortcuts:
.= Current folder..= Parent folder (up one level)%USERPROFILE%= Your home folder
Common Navigation Patterns
Pattern 1: Navigating Down
C:\>cd Users
C:\Users>cd YourName
C:\Users\YourName>cd Documents
C:\Users\YourName\Documents>
Pattern 2: Navigating Up
C:\Users\YourName\Documents>cd ..
C:\Users\YourName>cd ..
C:\Users>cd ..
C:\>
Pattern 3: Jump to a Known Path
C:\Deep\Folder\Somewhere>cd C:\Users\YourName
C:\Users\YourName>
Pattern 4: Going Home
cd %USERPROFILE%
Special Folders and Shortcuts
%USERPROFILE% :: Your home folder
%USERPROFILE%\Desktop :: Your Desktop
%USERPROFILE%\Documents :: Your Documents
%USERPROFILE%\Downloads :: Your Downloads
%ProgramFiles% :: Program Files folder
C:\ :: Root of C drive
Tab Completion (Essential Skill)
- Type the first few characters of a folder name.
- Press Tab.
- Command Prompt completes it.
Example:
C:\Users\YourName>cd Doc [press Tab]
C:\Users\YourName>cd Documents
- Your screen reader announces the completed name immediately.
- Press Tab multiple times to cycle through all matches.
Screen Reader Tips for Navigation
NVDA Users
- After each
cdcommand, runcdalone to confirm location. Press NVDA+Home (Insert+Home) to read the current line. - Press NVDA+Down Arrow to read through
dir /Boutput. - For long listings:
dir /B > listing.txt, thennotepad.exe listing.txt.
JAWS Users
- After each
cdcommand, press Insert+Up Arrow to re-read the current line. - Press Insert+Down Arrow repeatedly to read output line by line.
- For long listings:
dir /B > listing.txt, thennotepad.exe listing.txt.
Windows Narrator Users
- After each
cdcommand, press Narrator+D (CapsLock+D) to read the current line. - Press Narrator+R to read output from the current position.
- For long listings, always redirect to a file and open in Notepad — Notepad is more comfortable for Narrator users than reading directly from the terminal buffer.
Dolphin SuperNova Users
- After each
cdcommand, press CapsLock+L to read the current line. - Press CapsLock+Numpad Plus (say all) to read all output from the current position.
- For long listings:
dir /B > listing.txt, thennotepad.exe listing.txt.
Best Practice for All Screen Readers
Always confirm your location after moving:
cd FolderName
cd :: Verify your new location
Practice Exercises
Exercise 1: Basic Down Navigation
cd %USERPROFILE%- Run
cdto see location. dir /Bcd Documents- Run
cdto confirm. dir /B
Exercise 2: Using Tab Completion
cd %USERPROFILE%- Type
cd Docthen press Tab. - Press Enter.
- Run
cdto confirm.
Exercise 3: Navigating Up
- Navigate several levels deep.
- Run
cdto see full path. - Use
cd ..to go up one level at a time. - Run
cdafter each step.
Exercise 4: Absolute Path Navigation
- Navigate deep (3+ levels).
- Run
cd %USERPROFILE%to jump home. - Run
cdto confirm.
Exercise 5: Creating and Navigating a Structure
mkdir 3DPractice
cd 3DPractice
mkdir Models
cd Models
mkdir OpenSCAD
cd OpenSCAD
Run cd at each level. Then navigate back up using only cd ...
Checkpoint Questions
Answer all 10 before moving to Command Line Lesson 2:
- What is the difference between
cd Documentsandcd \? - What does
cd ..do? - How do you go to your home folder from anywhere?
- What is an absolute path? Give an example.
- What is a relative path? Give an example.
- How do you confirm your current location?
- What does Tab completion do?
- How would you navigate 3 levels deep, then back home?
- What is the difference between
.and..? - If you are lost, what command should you run first?
Extension Problems
- Create a folder with spaces in the name (e.g.,
My Projects) and navigate to it using quotes. - Use Tab completion to navigate 5+ levels deep without typing full names.
- Create a script that saves
cdoutput at each level to a log file. - Navigate to the same destination using both absolute and relative paths from different starting locations.
- Build a complex folder tree (5+ levels) and navigate using only relative paths.
- Document the full paths to your 5 most-used folders.
- Create folders named
01Folder,02Folder, etc. and practice Tab completion through them. - Navigate to a folder, save the path with
cd > mypath.txt, navigate away, then return using the saved path. - Challenge: navigate to a destination using only relative paths without running
cdto check at each step. - Create a batch file that navigates to a project folder and lists its contents in one step.
Common Issues
“The system cannot find the path specified”
- Check spelling with
dir /Bto see correct folder names. - Use Tab completion to avoid typos.
- Use the absolute path:
cd C:\Users\YourName\Documents.
“I’m lost”
cd
This always shows your current location.
Tab Completion Not Working
- Type at least one character before pressing Tab.
- Confirm the folder exists with
dir /B. - Press Tab again to cycle through multiple matches.
Quick Reference
cd :: Show current location
cd FolderName :: Go into a folder
cd .. :: Go up one level
cd ..\.. :: Go up two levels
cd \ :: Go to drive root
cd %USERPROFILE% :: Go to home folder
dir /B :: List folder contents
dir /B /A:D :: List only folders
dir /B /A:F :: List only files
Next Steps
Complete all exercises, pass the checkpoint questions, then move to Command Line Lesson 2: File & Folder Manipulation.
Lesson 2: File and Folder Manipulation
Duration: 2-2.5 hours (for screen reader users)
Prerequisites: Command Line Lesson Pre, Command Line Lesson 0, Command Line Lesson 1
Learning Objectives:
- Create, copy, move, and delete files and folders safely
- Use wildcards to operate on multiple files
- Understand dangerous operations and how to stay safe
- Rename files and understand file extensions
Core File Manipulation Commands
Create Folders: mkdir
mkdir FolderName :: Create a single folder
mkdir Folder1 Folder2 Folder3 :: Create multiple folders at once
mkdir A\B\C :: Create nested folders (A, then B inside A, then C inside B)
Create Files: echo with Redirection
echo This is some content > filename.txt :: Create a file with text content
echo. > emptyfile.txt :: Create an empty file
Note: echo. (echo followed immediately by a period, no space) creates an empty file. echo with a space would put a space character in the file.
Copy Files: copy
copy source.txt destination.txt :: Copy a file to a new name
copy source.txt backup\ :: Copy a file into a folder
copy *.txt backup\ :: Copy all .txt files to backup folder
Copy Folders: xcopy
xcopy sourcefolder destinationfolder /E /I :: Copy a folder and all its contents
/Ecopies all subdirectories including empty ones./Itreats the destination as a folder (not a file) if it doesn’t exist.
Move and Rename: move
move oldname.txt newname.txt :: Rename a file
move file.txt folder\ :: Move a file into a folder
move *.txt archive\ :: Move all .txt files to archive folder
move renames when both source and destination are in the same folder. It moves when the destination is a different folder.
Delete Files: del
Caution
The
/Qflag suppresses the confirmation prompt —del /Qdeletes immediately and silently. Only use/Qin scripts where you have already verified the targets; never use it interactively when learning.
del filename.txt :: Delete one specific file
del *.txt :: Delete all .txt files in current folder
del /Q *.tmp :: Delete quietly (no confirmation prompt)
Warning
deldoes not send files to the Recycle Bin. Deleted files are permanently gone with no undo. Always verify the target withdir /Bbefore deleting.
Delete Folders: rmdir
rmdir foldername :: Delete an empty folder
rmdir /S /Q foldername :: Delete a folder and ALL its contents (no undo)
Warning
rmdir /S /Qpermanently deletes a folder and all its contents with no confirmation and no undo. Always verify the exact folder name withdir /Bfirst — one wrong character can delete the wrong folder entirely.
Safe File Operations
Caution
Check, then delete. Never run
delorrmdirwithout first runningdir /Bto confirm exactly what you’re about to remove. Wildcards likedel *.txtwill delete every matching file instantly and permanently.
Rule 1: Always Check Before Deleting
dir /B :: See exactly what is here
dir /B *.txt :: See exactly which .txt files exist
del *.txt :: Only then delete
Rule 2: Make Backups First
mkdir backup
copy *.txt backup\ :: Copy all .txt files to a backup folder first
del *.txt :: Now safe to delete originals
Rule 3: Test on One File First
del test-one-file.txt :: Test deletion on a single file
dir /B :: Confirm it is gone
Only then proceed with bulk operations.
Using Wildcards
Wildcards let you operate on multiple files matching a pattern.
* Wildcard (Match Any Number of Characters)
dir /B *.txt :: List all files ending in .txt
copy *.scad backup\ :: Copy all .scad files to backup
del *.tmp :: Delete all .tmp files
? Wildcard (Match Exactly One Character)
dir /B file?.txt :: Matches file1.txt, file2.txt, filea.txt, etc.
copy model?.scad models\ :: Copy model1.scad, model2.scad, etc.
Practical Examples
3DMake in Practice: Navigating a Project
Navigation commands are exactly what you need to explore and manage 3DMake projects:
REM Go to your project root
cd %USERPROFILE%\Documents\3d_projects\my_cube
REM See the project layout: src, build, 3dmake.toml
dir /B
REM Enter the source folder where your .scad model files live
cd src
dir /B
REM Open the main model in Notepad
3dm edit-model
REM Go back to project root, then check build output
cd ..
cd build
dir /B *.stl
REM Return to project root
cd ..
REM Use wildcards to find all projects with "cube" in the name
dir /B %USERPROFILE%\Documents\3d_projects\*cube*
Tab completion makes navigation fast: type cd %USERPROFILE%\Doc and press Tab.
Practical Examples
Example 1: Create a Project Structure
mkdir 3DProjects
cd 3DProjects
mkdir Models Prints Documentation Backups
dir /B /A:D
Example 2: Backup Before Editing
copy project.scad project-backup.scad :: Create a backup copy
:: (edit project.scad)
copy project.scad project-v2.scad :: Save a new versioned copy
Example 3: Organize Files by Type
mkdir scad-files
mkdir text-files
move *.scad scad-files\
move *.txt text-files\
dir /B /A:D
Practice Exercises
Exercise 1: Create a Folder Structure
mkdir practice-sessioncd practice-sessionmkdir files documents modelsdir /B /A:D
Goal: Create organized folder structures confidently.
Exercise 2: Create and Copy Files
echo Hello World > test.txttype test.txtcopy test.txt test-backup.txtdir /B *.txttype test-backup.txt
Goal: Create and copy files without errors.
Exercise 3: Safe Deletion Practice
echo content > file1.txtecho content > file2.txtecho content > file3.txtdir /B *.txt(confirm all three exist)del file1.txt(delete just one)dir /B *.txt(confirm only two remain)
Goal: Practice the “check, then delete” pattern.
Exercise 4: Wildcard Operations
3DMake in Practice: Organizing Your Projects
File management commands are essential for 3DMake project organization:
REM Create a new project from scratch
mkdir %USERPROFILE%\Documents\3d_projects\bottle_cap
cd %USERPROFILE%\Documents\3d_projects\bottle_cap
3dm new
REM Back up a working project before making big changes
cd %USERPROFILE%\Documents\3d_projects
xcopy /E /I bottle_cap bottle_cap_backup
REM Rename the main model file to something more specific
cd bottle_cap\src
rename main.scad bottle_cap.scad
REM List only .scad files to confirm the rename
dir /B *.scad
REM Delete a draft STL you no longer need
del %USERPROFILE%\Documents\3d_projects\bottle_cap\build\draft.stl
REM Build the renamed model (using the -m flag to specify the name)
cd %USERPROFILE%\Documents\3d_projects\bottle_cap
3dm build -m bottle_cap
REM See the fresh output in the build folder
dir /B build
Exercise 4: Wildcard Operations
- Create three files:
echo a > doc1.txt,echo b > doc2.txt,echo c > doc3.txt dir /B *.txtmkdir archivecopy *.txt archive\cd archivedir /B *.txt
Goal: Comfortable using wildcards for bulk operations.
Screen Reader Tips
NVDA Users
After file operations, run dir /B and press NVDA+Down Arrow to verify results. Redirect output to a file for complex verification: dir /B > check.txt, then notepad.exe check.txt.
JAWS Users
After file operations, run dir /B and press Insert+Down Arrow to read results. For complex output: dir /B > check.txt, then notepad.exe check.txt.
Windows Narrator Users
After file operations, run dir /B and press Narrator+R to read from the current position. Redirect to a file and open in Notepad for long output.
Dolphin SuperNova Users
After file operations, run dir /B and press CapsLock+Numpad Plus to read results. For long output: dir /B > check.txt, then notepad.exe check.txt.
Important
After any
copy,move, ordeloperation, always verify withdir /Bto confirm the expected result. Never assume an operation succeeded without checking — silent failures do occur.
General Tip for All Screen Readers
After any copy, move, or del operation, always verify with dir /B to confirm the expected result. Never assume an operation worked without checking.
Checkpoint Questions
- How do you create a folder?
- How do you copy a file?
- How do you rename a file?
- How do you delete a file safely (checking first)?
- What does
*match in a wildcard pattern? - What does
?match in a wildcard pattern? - How would you copy all .scad files to a backup folder?
- What should you always do before deleting?
- How do you delete a folder and all its contents?
- Why is it important to create a backup before editing?
Extension Problems
- Create a nested folder structure (5+ levels) using a single
mkdircommand with backslashes. - Create 10 files and organize them into subfolders using
movewith wildcards. - Create a date-based backup strategy: copy all files to a folder named with today’s date.
- Use wildcards to select specific file types and copy them to separate organized folders.
- Create a file-renaming system (file001.txt, file002.txt, etc.) and practice moving them between folders.
Next Steps
Complete all exercises, pass the checkpoint questions, then move to Command Line Lesson 3: Input, Output & Redirection.
Lesson 3: Input, Output, and Piping
Duration: 1 class period Prerequisite: Command Line Lesson 2 (File and Folder Manipulation)
Learning Objectives
By the end of this lesson, you will be able to:
- Use
echoto print text to the screen - Use
typeto read file contents - Use
>to redirect output into a file - Use
|(pipe) to send one command’s output to another - Copy output to the clipboard with
clip - Open files with a text editor from the command line
Commands Covered
| Command | What It Does |
|---|---|
echo text | Print text to the screen |
type filename | Print the contents of a file |
> filename | Redirect output into a file (overwrites) |
>> filename | Append output to a file (adds to end) |
| | Pipe - send output from one command to the next |
clip | Copy piped input to the Windows clipboard |
notepad filename | Open a file in Notepad |
echo - Printing Text
echo prints text to the screen. It is useful for testing, for writing text into files, and for understanding how piping works.
echo Hello, World
echo This is a test
type - Reading Files
type prints the contents of a file to the screen.
:: Read a text file
type %USERPROFILE%\Documents\notes.txt
:: Read an OpenSCAD file
type %USERPROFILE%\Documents\OpenSCAD_Projects\project0.scad
With a long file, use type filename | more to read it page by page (press Space to advance, Q to quit).
> - Redirecting Output to a File
The > symbol redirects output from the screen into a file instead.
:: Create a file with a single line
echo Author: Your Name > header.txt
:: Confirm the file was created and has content
type header.txt
Warning: > overwrites the file if it already exists. Use >> to append instead:
echo Date: 2025 >> header.txt
echo Project: Floor Marker >> header.txt
type header.txt
| - Piping
The pipe symbol | sends the output of one command to the input of the next. This lets you chain commands together.
:: List files and send the list to clip (copies to clipboard)
dir /B | clip
## 3DMake in Practice: Capturing Build Output
Piping and redirection are essential for working with 3DMake's output accessibly:
```cmd
REM Build and save the full log to a file so you can read it in Notepad
3dm build > build_log.txt
notepad build_log.txt
REM Build and slice, keeping only lines with errors or warnings
3dm build slice 2>&1 | findstr /I "error warning"
REM List all STL files produced so far
dir /B build\*.stl
REM Get a list of available printer profiles and save for reference
3dm list-profiles > profiles.txt
notepad profiles.txt
REM Get a list of material overlays (PLA, PETG, supports, etc.)
3dm list-overlays > overlays.txt
notepad overlays.txt
REM Get an AI description of your model and save it
3dm info > model_description.txt
notepad model_description.txt
:: List files and send the list to clip (copies to clipboard)
dir /B | clip
:: Now paste with Ctrl + V anywhere
:: Search within a file's contents using find
type project0.scad | find "cube"
clip - Copying to Clipboard
clip takes whatever is piped to it and puts it on the Windows clipboard.
:: Copy your current directory path to the clipboard
cd | clip
:: Copy a file listing to clipboard
dir /B | clip
:: Copy the contents of a file to clipboard
type notes.txt | clip
After any of these, press Ctrl + V in any application to paste.
Opening Files in Notepad
:: Open a file in Notepad
notepad %USERPROFILE%\Documents\notes.txt
:: Open a .scad file
notepad %USERPROFILE%\Documents\OpenSCAD_Projects\project0.scad
:: Create a new file and open it
echo. > new_notes.txt
notepad new_notes.txt
Step-by-step Tasks
- Create
practice.txtwith three lines usingechoand>/>>. - Read the file with
type practice.txt. - Pipe the file into
findto search for a word. - Copy the file contents to clipboard with
type practice.txt | clip. - Redirect
dir /Bintolist.txtand open it in Notepad.
Checkpoints
- After step 3 you should be able to find a keyword using piping.
Quiz - Lesson CMD.3
- What is the difference between
>and>>? - What does the pipe
|do? - How do you copy output to the clipboard?
- How would you page through long output?
- How do you suppress output (send it nowhere)?
- True or False: The pipe operator
|connects the output of one command to the input of another. - Explain why redirecting output to a file is useful for screen reader users.
- Write a command that would search for the word “sphere” in all
.scadfiles in a directory. - How would you count the number of lines in a file using CMD piping?
- Describe a practical scenario in 3D printing where you would pipe or redirect command output.
- What would be the difference in output between
echo test > file.txt(run twice) vsecho test >> file.txt(run twice)? Show the expected file contents. - Design a three-step piping chain: read a file, filter for specific content, and save the results; explain what each pipe does.
- You have a 500-line
.scadfile and need to find all instances ofsphere()and count them. Write the command. - Explain how
clipis particularly valuable for screen reader users when working with file paths or long output strings. - Describe how you would use pipes and redirection to create a timestamped backup report of all
.stlfiles in a 3D printing project folder.
Extension Problems
- Use piping to count lines in a file (hint:
type file.txt | find /C /V ""). - Save a long
dir /Boutput and search it withfind. - Chain multiple pipes to filter and then save results.
- Practice copying different command outputs to clipboard and pasting.
- Create a small batch script that generates a report (counts of files by extension).
- Build a data processing pipeline: read a text file, filter rows, and export results; document each step.
- Write a batch script that pipes directory listing to count occurrences of each file extension; create a summary report.
- Create a log analysis command: read a log file, filter for errors, and save matching lines to a separate error log.
- Design a piping workflow for 3D printing file management: find
.stlfiles, extract their names, and generate a report. - Develop a reusable piping pattern library: create batch scripts for common filtering, sorting, and reporting patterns; test each with different inputs.
- Build a complex filter pipeline: read a
.scadfile, extract lines containing specific geometry commands, count each type, and output a summary to both screen and file. - Create an interactive filtering tool: build a batch script that accepts a search term, pipes through multiple filters, and displays paginated results.
- Develop a performance analysis tool: use piping to combine file listing, metadata extraction, and statistical reporting; export results to a dated report file.
- Implement a comprehensive error-handling pipeline: read output, catch errors, log them separately, and generate a summary of successes vs failures.
- Design and execute a real-world project backup workflow: use piping to verify file existence, count files by type, generate a backup manifest, and create audit logs — all in one integrated command pipeline.
References
- Microsoft. (2024). Using redirection operators in CMD. https://example.com
- Microsoft. (2024). FIND command reference. https://example.com
- Microsoft. (2024). CMD pipeline concepts. https://example.com
Helpful Resources
- Using Redirection in CMD
- Piping and FIND
- TYPE Command Reference
- FINDSTR for Advanced Searching
- CMD Pipeline Concepts
Lesson 4: Environment Variables, PATH, and Aliases
Estimated time: 30-45 minutes
Learning Objectives
- Read environment variables with
%VARNAME% - Inspect and verify programs in the
PATH - Create temporary aliases with
doskeyand understand making them persistent via a startup script
Materials
- Command Prompt
Step-by-step Tasks
- Show your username and home path with
echo %USERNAME%andecho %USERPROFILE%. - Inspect
echo %PATH%and identify whetheropenscadorcodewould be found. - Run
where openscadand note the result. - Create a temporary alias:
doskey preview=openscad $*and testpreview myfile.scad. - Open your startup script (
notepad.exe autorun.bat) and add the doskey line to make it persistent (advanced).
Checkpoints
- After step 3 you can determine whether a program will be found by
PATH.
Quiz - Lesson CMD.4
3DMake in Practice: DOSKEY Macros for 3DMake
DOSKEY macros give you fast shortcuts for your most-used 3DMake commands:
REM Quick macro to jump to your 3D projects folder
doskey 3dp=cd %USERPROFILE%\Documents\3d_projects
REM Quick macro to run the full build-slice-print pipeline
doskey 3dprint=3dm build slice print
REM Quick macro to build then describe the model
doskey 3dinfo=3dm build $T 3dm info
REM Test the macros in the current session
3dp
3dprint
REM To make these permanent, add them to a startup batch file
notepad %USERPROFILE%\cmd_startup.cmd
REM Add the doskey lines, save, and then register via Windows Registry:
REM HKCU\Software\Microsoft\Command Processor\AutoRun = %USERPROFILE%\cmd_startup.cmd
Checkpoints
- After step 3 you can determine whether a program will be found by
PATH.
Quiz - Lesson CMD.4
- How do you print an environment variable?
- What is the purpose of
PATH? - How do you check whether
openscadis available? - How do you create a temporary alias in CMD?
- Where would you make an alias permanent?
- True or False: Environment variable names in CMD are case-sensitive.
- Explain why having a program in your PATH is useful compared to always using its full file path.
- Write a command that would create a doskey alias called
slicerfor the OpenSCAD executable. - What file or technique would you use to make a doskey alias persist across CMD sessions?
- Describe a practical benefit of using the
%TEMP%directory for temporary files in a 3D printing workflow. - You have a custom batch script at
C:\Scripts\backup_models.batthat you want to run from anywhere asbackup-now. What steps would you take to make this work? - Explain the difference between setting an environment variable in the current session with
setvs. usingsetxfor permanence. - Design a strategy for managing multiple 3D printing projects, each with different tool paths and directories; show how to structure environment variables for each.
- If a program is not found by
where, what are the possible reasons, and how would you troubleshoot? - Describe how you would verify that your CMD autorun script is loading correctly and how to debug issues if aliases or environment variables don’t appear after opening a new CMD session.
Extension Problems
- Add a folder to PATH for a test program (describe steps; do not change system PATH without admin).
- Create a short autorun snippet that sets two aliases and test re-opening CMD.
- Use
whereto list the path for several common programs. - Explore
%TEMP%and create a file there. - Save a copy of your current PATH to a text file and examine it in your editor.
- Create a CMD autorun script that loads custom aliases and environment variables for your 3D printing workflow; test it in a new session.
- Build a “project profile” batch script that sets environment variables for CAD, slicing, and print directories; switch between profiles for different projects.
- Write a batch script that audits your current environment variables and creates a summary report of what’s set and why.
- Design a custom alias system using doskey for common 3D printing commands; document the aliases and their purposes.
- Create a profile migration guide: document how to export and import your CMD aliases and variables across machines for consistent workflows.
- Implement a safe PATH modification script: create a utility that allows you to add/remove directories from PATH for the current session only; show how to make it permanent with
setx. - Build a comprehensive autorun framework: create separate
.batfiles for aliases, environment variables, and helper macros; have your main autorun load all of them. - Develop an environment validation tool: write a batch script that checks whether all required programs (OpenSCAD, slicers, etc.) are accessible via PATH; report findings and suggest fixes.
- Create a project-switching alias system: design a batch script that changes all environment variables and aliases based on the current project; test switching between multiple projects.
- Build a troubleshooting guide: create a batch script that exports your current environment state (variables, aliases, PATH) to a timestamped file, allowing you to compare states before and after changes.
References
- Microsoft. (2024). Environment variables in CMD. https://example.com
- Microsoft. (2024). DOSKEY command reference. https://example.com
- Microsoft. (2024). WHERE command reference. https://example.com
Helpful Resources
- Environment Variables in CMD
- Understanding the PATH Variable
- DOSKEY Alias Reference
- WHERE Command for Locating Programs
- SETX for Permanent Variables
Lesson 5: Filling in the Gaps — Startup Scripts, History, and Useful Tricks
Estimated time: 30-45 minutes
Learning Objectives
- Use history and abort commands (
doskey /history,F7,Ctrl+C) - Inspect and edit your CMD autorun script for persistent settings
- Run programs by full path using the
startor call operator - Handle common screen reader edge cases when using the terminal
Materials
- Command Prompt and an editor (Notepad/VS Code)
Step-by-step Tasks
- Run several simple commands (e.g.,
cd,dir /B,echo hi) then pressF7or rundoskey /historyto view them. - Use
F8to search back through history, or use the up-arrow to re-run a previous command. - Practice aborting a long-running command with
Ctrl + C(for example,ping 8.8.8.8). - Open your autorun script:
notepad.exe autorun.bat; if it doesn’t exist, create it withecho. > autorun.bat. - Add a persistent alias line to your autorun script (example:
doskey preview=openscad $*), save, and configure CMD to use it by registering it in the registry (advanced).
Checkpoints
- After step 2 you can re-run a recent command from history.
- After step 5 your alias should persist across CMD sessions.
Quiz - Lesson CMD.5
- How do you view the command history in CMD?
- Which key combination aborts a running command?
- What does
echo %CMDCMDLINE%show? - How does the
startcommand help run executables? - What is one strategy if terminal output stops being announced by your screen reader?
- True or False: Using
Ctrl+Cpermanently deletes any files created by the command you abort. - Explain the difference between pressing
F7and runningdoskey /historyin CMD. - If you add a doskey macro to your autorun script but it doesn’t take effect after opening a new CMD window, what should you verify?
- Write a command that would run a program at the path
C:\Program Files\OpenSCAD\openscad.exedirectly. - Describe a practical workflow scenario where having keyboard shortcuts (doskey macros) in your autorun script would save time.
- Explain how to re-run the 5th command from your history using
F7and selection, and what would happen if that command had file operations (creates/deletes). - Design an autorun initialization strategy that separates utilities for different projects; explain how you would switch between them.
- Walk through a troubleshooting workflow: your screen reader stops announcing output after running a long command. What steps would you take to diagnose and resolve the issue?
- Create a safety checkpoint system: before any destructive operation (mass delete, overwrite), how would you use autorun macros and history to verify the command is correct?
- Develop a comprehensive capstone scenario: integrate everything from Command Line Lesson 0 through Command Line Lesson 5 (navigation, file operations, piping, environment setup, history) to design an automated 3D printing project workflow with error handling and logging.
Extension Problems
- Add a doskey macro and an environment variable change to your autorun script and document the behavior after reopening CMD.
- Create a short batch script that automates creating a project folder and an initial
.scadfile. - Experiment with running OpenSCAD by full path using
startand by placing it in PATH; compare results. - Practice redirecting
helpoutput to a file and reading it in Notepad for screen reader clarity. - Document three screen reader troubleshooting steps you used and when they helped.
- Build a comprehensive CMD autorun script that includes aliases, environment variables, and helper macros for your 3D printing workflow.
- Create a batch script that troubleshoots common CMD issues (missing commands, permission errors, command not found); test at least three scenarios.
- Write a batch script that coordinates multiple tasks: creates a project folder, starts OpenSCAD, and opens a notes file.
- Design a screen-reader accessibility guide for CMD: document commands, outputs, and accessible navigation patterns.
- Develop an advanced CMD workflow: implement error handling, logging, and confirmation prompts for risky operations.
- Implement an “undo” system using history: create a batch script that logs destructive commands (
del,move,copy /Y) and allows you to review the last operation. - Build an autorun debugger: create a script that compares two CMD sessions’ environment states (variables, aliases, macros) to identify what loaded/failed to load.
- Develop a multi-project autorun manager: design a system where you can switch entire environments (paths, aliases, variables) for different 3D printing projects by running a single script.
- Create a comprehensive accessibility analyzer: write a batch script that tests whether key CMD commands produce screen-reader-friendly output; document workarounds for commands that don’t.
- Design a complete capstone project: build an integrated automation suite that manages a 3D printing workflow (project setup, file organization, CAD/slicing tool automation, output logging, error recovery, and audit trails) with full error handling and documentation.
References
- Microsoft. (2024). CMD history and recall functionality. https://example.com
- Microsoft. (2024). Using CMD autorun scripts. https://example.com
- Microsoft. (2024). The START command for running executables. https://example.com
Helpful Resources
- DOSKEY History and Recall
- CMD Autorun Scripts
- START Command Reference
- CMD History Navigation
- Screen Reader Tips for CMD
Lesson 6: Advanced Techniques — Batch Scripts, Subroutines, and Professional Workflows
Duration: 4-4.5 hours (for screen reader users) Prerequisites: Complete Command Line Lesson 0 through Command Line Lesson 5 Skill Level: Advanced intermediate
3DMake in Practice: Automating Your Print Workflow
Use a batch script to fully automate a 3DMake workflow across multiple projects:
@echo off
REM batch_print.bat - build and print every 3DMake project subfolder
set PROJECTS=%USERPROFILE%\Documents\3d_projects
for /D %%P in ("%PROJECTS%\*") do (
echo Processing: %%~nxP
cd "%%P"
3dm build slice > build_log.txt 2>&1
if %ERRORLEVEL% EQU 0 (
echo OK - sending to printer
3dm print
) else (
echo FAILED - check build_log.txt
notepad build_log.txt
)
)
echo Batch complete.
Save as batch_print.bat and run by typing batch_print. This script uses loops, conditionals, and output redirection — all from this lesson.
This lesson extends CMD skills to professional-level workflows. You’ll learn to automate complex tasks, write reusable batch scripts, and integrate tools for 3D printing workflows.
Learning Objectives
By the end of this lesson, you will be able to:
- Create and run batch files (.bat files)
- Write subroutines that accept parameters
- Use loops to repeat tasks automatically
- Automate batch processing of 3D models
- Debug batch scripts when something goes wrong
- Create professional workflows combining multiple tools
Batch Script Basics
What’s a Batch Script?
A batch file (.bat) contains multiple CMD commands that run in sequence. Instead of typing commands one by one, you put them in a file and run them all at once.
Why use batch scripts?
- Repeatability: Run the same task 100 times identically
- Documentation: Commands are written down for reference
- Complexity: Combine many commands logically
- Automation: Schedule scripts to run automatically
Creating Your First Batch Script
Step 1: Open a text editor
notepad.exe my-first-script.bat
Step 2: Type this script
@echo off
:: This is a comment - screen readers will read it
echo Script is running!
cd
dir /B
echo Script is done!
Step 3: Save the file
- In Notepad: Ctrl+S
- Make sure filename ends in
.bat - Save in an easy-to-find location (like Documents)
Step 4: Run the script
my-first-script.bat
What happens: CMD runs each command in sequence and shows output.
Important: @echo off
On some scripts, each command is echoed before running. @echo off at the top suppresses this, showing only output — not the commands themselves.
@echo off
:: Now only output is shown, not each command
echo Hello!
Variables and Parameters
Using Variables
Variables store values you want to use later.
Example script:
@echo off
set mypath=C:\Users\YourName\Documents
cd %mypath%
echo I am now in:
cd
dir /B
Breaking it down:
set mypath=...assigns the variable%mypath%uses the variable (wraps it in%)- Variables in CMD are always referenced with
%VARNAME%
Subroutines with Parameters
A subroutine is reusable code that you can call with different inputs using :label and call.
Example: A subroutine that lists files in a folder
@echo off
call :ListFolder "C:\Users\YourName\Documents"
call :ListFolder "C:\Users\YourName\Downloads"
goto :eof
:ListFolder
echo Contents of: %~1
cd /D %~1
dir /B
goto :eof
What’s happening:
:ListFoldermarks the start of the subroutine%~1is the first argument passed to the subroutinecall :ListFolder "path"calls the subroutine with a pathgoto :eofexits the subroutine (or script)
Screen reader tip: When you call a subroutine, CMD will announce the results just like any command.
Loops - Repeating Tasks
Loop Over Files
Imagine you have 10 SCAD files and want to print their names. You could do it 10 times manually, or use a loop.
Example: Print every .scad file in a folder
@echo off
for %%f in (*.scad) do (
echo === File: %%f ===
type %%f
echo.
)
What’s happening:
for %%f in (*.scad) doiterates over each.scadfile%%fis the loop variable (use%fin interactive CMD,%%fin batch files)- Inside the parentheses, do something with each file
Loop with a Counter
Example: Do something 5 times
@echo off
for /L %%i in (1,1,5) do (
echo This is iteration number %%i
)
What’s happening:
for /L %%i in (start,step,end)counts from start to end%%iis the counter variable
Real-World Example - Batch Processing SCAD Files
Scenario
You have 10 OpenSCAD (.scad) files in a folder. You want to:
- List them all
- Check how many there are
- For each one, verify it exists
The Script
@echo off
set scadFolder=C:\Users\YourName\Documents\3D_Projects
set count=0
echo Processing SCAD files in: %scadFolder%
echo.
for %%f in (%scadFolder%\*.scad) do (
if exist "%%f" (
echo Found: %%~nxf
set /A count+=1
) else (
echo Missing: %%~nxf
)
)
echo.
echo Total files found: %count%
echo Batch processing complete!
Breaking it down:
set scadFolder=...= where to lookfor %%f in (...\*.scad)= find all .scad filesif exist "%%f"= check if file exists%%~nxf= just the filename with extension (not the full path)set /A count+=1= increment the counter
Running the Script
-
Save as
batch-process.bat -
Edit
scadFolderto match your real folder -
Run it:
batch-process.bat
Screen reader output:
Processing SCAD files in: C:\Users\YourName\Documents\3D_Projects
Found: model1.scad
Found: model2.scad
Found: model3.scad
[... more files ...]
Total files found: 10
Batch processing complete!
Error Handling
Checking Error Levels
What if something goes wrong? Use errorlevel checks:
Example:
@echo off
type C:\nonexistent\path\file.txt
if %errorlevel% neq 0 (
echo Error: Could not read file
echo Errorlevel: %errorlevel%
)
What’s happening:
- After any command,
%errorlevel%holds0for success or non-zero for failure if %errorlevel% neq 0checks for failure- Handle the error gracefully
Screen reader advantage: Errors are announced clearly instead of crashing silently.
Validating Input
Example: Make sure a folder exists before processing
@echo off
set folderPath=C:\Users\YourName\Documents
if not exist "%folderPath%\" (
echo Error: Folder does not exist: %folderPath%
goto :eof
)
echo Processing folder: %folderPath%
dir /B "%folderPath%"
What’s happening:
if not exist "%folderPath%\"checks if folder exists (trailing\ensures it’s a folder)goto :eofexits the script early if error
Debugging Batch Scripts
Common Errors and Solutions
Error 1: “Command not found”
Cause: Typo in command name or program not in PATH
Fix: Check spelling and verify PATH
:: Wrong:
dri /B
:: Correct:
dir /B
Error 2: “Variable is empty”
Cause: Variable was never set or has a typo
Fix: Make sure variable is set before using it
set myvar=hello
echo %myvar%
Error 3: “The system cannot find the path specified”
Cause: Wrong folder path
Fix: Verify path exists
:: Check if path exists:
if exist "C:\Users\YourName\Documents\" echo Path exists
Error 4: “Access denied”
Cause: Don’t have permission
Fix: Run CMD as administrator
- Right-click Command Prompt -> Run as administrator
Debugging Technique: Trace Output
Add echo statements to track what’s happening:
@echo off
set path_var=C:\Users\YourName\Documents
echo Starting script. Path is: %path_var%
for %%f in (%path_var%\*) do (
echo Processing: %%f
:: Do something with %%f
echo Done with: %%f
)
echo Script complete
Your screen reader will announce each step, so you know where errors happen.
Creating Professional Workflows
Example 1: Automated Project Setup
Scenario: You start a new 3D printing project regularly. Instead of creating folders manually:
@echo off
set /p projectName=Enter project name:
set baseFolder=C:\Users\YourName\Documents\3D_Projects
set projectFolder=%baseFolder%\%projectName%
:: Create folder structure
mkdir "%projectFolder%"
mkdir "%projectFolder%\designs"
mkdir "%projectFolder%\output"
mkdir "%projectFolder%\notes"
:: Create a README
echo # %projectName% > "%projectFolder%\README.txt"
echo. >> "%projectFolder%\README.txt"
echo Created: %date% >> "%projectFolder%\README.txt"
echo. >> "%projectFolder%\README.txt"
echo ## Designs >> "%projectFolder%\README.txt"
echo All .scad files go here. >> "%projectFolder%\README.txt"
echo. >> "%projectFolder%\README.txt"
echo ## Output >> "%projectFolder%\README.txt"
echo STL and other exports go here. >> "%projectFolder%\README.txt"
echo Project setup complete: %projectFolder%
What it does:
- Prompts for a project name
- Creates folder structure for a new project
- Sets up subfolders for designs, output, notes
- Creates a README file automatically
Example 2: Batch File Verification
Scenario: Before processing, verify all required files exist:
@echo off
set projectFolder=C:\Users\YourName\Documents\3D_Projects\MyKeychain
set allGood=1
for %%i in (README.txt designs output notes) do (
if exist "%projectFolder%\%%i" (
echo Found: %%i
) else (
echo Missing: %%i
set allGood=0
)
)
if %allGood%==1 (
echo All checks passed!
) else (
echo Some files are missing!
)
Screen Reader Tips for Batch Scripts
Making Script Output Readable
Problem: Script runs but output scrolls too fast or is hard to follow
Solution 1: Save to file
my-script.bat > output.txt
notepad.exe output.txt
Solution 2: Use echo with clear sections
echo ========== STARTING ==========
echo.
:: ... script ...
echo.
echo ========== COMPLETE ==========
Solution 3: Pause between major sections
echo Pausing... Press any key to continue
pause > nul
Your screen reader will announce the pause, give you time to read output.
Announcing Progress
For long-running scripts:
@echo off
set count=0
for %%f in (*.scad) do (
set /A count+=1
echo Processing file %%f
)
echo All %count% files processed!
Practice Exercises
Exercise 1: Your First Batch Script
Goal: Create and run a simple batch script
Steps:
-
Create file:
notepad.exe hello.bat -
Type:
@echo off echo Hello from my first CMD batch script! cd dir /B -
Save and run:
hello.bat
Checkpoint: You should see output for each command.
Exercise 2: Script with a Variable
Goal: Use a variable to make the script flexible
Steps:
-
Create file:
notepad.exe smart-listing.bat -
Type:
@echo off set targetFolder=C:\Users\YourName\Documents echo Listing contents of: %targetFolder% dir /B "%targetFolder%" -
Edit
targetFolderto a real folder on your computer -
Run:
smart-listing.bat
Checkpoint: You should see listing of that specific folder.
Exercise 3: Subroutine
Goal: Create a reusable subroutine
Steps:
-
Create file:
notepad.exe navigate.bat -
Type:
@echo off call :GoTo "C:\Users\YourName\Documents" call :GoTo "C:\Users\YourName\Downloads" goto :eof :GoTo if exist "%~1\" ( cd /D "%~1" echo Now in: cd echo Contents: dir /B ) else ( echo Path does not exist: %~1 ) goto :eof -
Run:
navigate.bat
Checkpoint: Both subroutine calls should work, showing contents of each folder.
Exercise 4: Loop
Goal: Use a loop to repeat an action
Steps:
-
Create file:
notepad.exe repeat.bat -
Type:
@echo off echo Demonstrating a loop: for /L %%i in (1,1,5) do ( echo Iteration %%i: Hello! ) echo Loop complete! -
Run:
repeat.bat
Checkpoint: Should print “Iteration 1” through “Iteration 5”.
Exercise 5: Real-World Script
Goal: Create a useful script for a real task
Steps:
-
Create a folder:
mkdir C:\Users\YourName\Documents\TestFiles -
Create some test files:
echo test > C:\Users\YourName\Documents\TestFiles\file1.txt echo test > C:\Users\YourName\Documents\TestFiles\file2.txt echo test > C:\Users\YourName\Documents\TestFiles\file3.txt -
Create script:
notepad.exe report.bat -
Type:
@echo off set folder=C:\Users\YourName\Documents\TestFiles set count=0 echo === FILE REPORT === echo Folder: %folder% echo. echo Files: for %%f in ("%folder%\*") do ( echo - %%~nxf set /A count+=1 ) echo. echo Total: %count% files echo === END REPORT === -
Run:
report.bat
Checkpoint: Should show report of all files in the test folder.
Quiz - Lesson CMD.6
- What is a CMD batch script?
- What file extension do CMD batch scripts use?
- What is a variable in a batch script and how do you create one?
- What is a subroutine (
:label) and why would you use one? - How do you run a batch script?
- What is a
forloop and what doesfor %%f in (*.scad) dodo? - What does
if existdo? - How do you handle errors in a batch script?
- When would you use
if %errorlevel% neq 0? - What technique makes batch script output readable for screen readers?
Extension Problems
- Auto-Backup Script: Create a batch script that copies all files from one folder to another, announcing progress
- File Counter: Write a subroutine that counts files by extension (.txt, .scad, .stl, etc.)
- Folder Cleaner: Batch script that deletes files older than 30 days (with user confirmation)
- Project Template: Subroutine that creates a complete project folder structure with all needed files
- Batch Rename: Script that renames all files in a folder according to a pattern
- Log Generator: Create a script that records what it does to a log file for later review
- Scheduled Task: Set up a batch script to run automatically every day at a specific time
- File Verifier: Check that all SCAD files in a folder have corresponding STL exports
- Report Generator: Create a summary report of all projects in a folder
- Error Tracker: Script that lists all commands that had errors and logs them with timestamps
Important Notes
- Always test scripts on small sets of files first before running them on important data
- Save your work regularly — use version naming if possible
- Test error handling — make sure errors don’t crash silently
- Document your scripts — use
::comments so you remember what each part does - Backup before batch operations — if something goes wrong, you have the original
References
- Microsoft CMD Batch Scripting Guide: https://example.com
- FOR Loop Documentation: https://example.com
- IF Statement Reference: https://example.com
- SET Variable Reference: https://example.com
Next Steps: After mastering this lesson, explore advanced batch scripting, scheduled tasks, and 3D printing integration in the main curriculum.
Unit Exam — Comprehensive Assessment
Estimated time: 60-90 minutes
Key Learning Outcomes Assessed
By completing this unit test, you will demonstrate:
- Understanding of file system navigation and path concepts
- Proficiency with file and folder manipulation commands
- Ability to redirect and pipe command output
- Knowledge of environment variables and aliases
- Screen-reader accessibility best practices in terminal environments
- Problem-solving and command chaining skills
Target Audience
Users who have completed Command Line Lesson 0 through Command Line Lesson 6 and need to demonstrate mastery of Command Prompt fundamentals.
Instructions
Complete all sections below. For multiple choice, select the best answer. For short answers, write one to two sentences. For hands-on tasks, capture evidence (screenshots or output files) and submit alongside your answers.
Part A: Multiple Choice Questions (20 questions)
Select the best answer for each question. Each question is worth 1 point.
-
What is the primary purpose of the
PATHenvironment variable?- A) Store your home directory location
- B) Tell the shell where to find executable programs
- C) Configure the visual appearance of the terminal
- D) Store the current working directory name
-
Which command shows your current working directory in CMD?
- A)
dir /B - B)
cd(with no arguments) - C)
pwd - D)
whoami
- A)
-
What does
%USERPROFILE%represent in CMD?- A) The root directory
- B) The current directory
- C) The parent directory
- D) Your home directory
-
How do you list only file names (not full details) in a screen-reader-friendly way?
- A)
dir - B)
dir /B - C)
dir /L - D)
type /B
- A)
-
Which command creates a new empty file in CMD?
- A)
mkdir filename - B)
echo. > filename - C)
touch filename - D)
new filename
- A)
-
What is the difference between
>and>>?- A)
>redirects to file,>>displays on screen - B)
>overwrites a file,>>appends to a file - C) They do the same thing
- D)
>is for text,>>is for binary
- A)
-
What does the pipe operator
|do?- A) Creates a folder
- B) Sends the output of one command to the input of another
- C) Deletes files matching a pattern
- D) Lists all processes
-
Which command copies a file in CMD?
- A)
move - B)
del - C)
copy - D)
cd
- A)
-
How do you rename a file from
oldname.txttonewname.txtin CMD?- A)
copy oldname.txt newname.txt - B)
move oldname.txt newname.txt - C)
rename oldname.txt newname.txt - D) Both B and C are correct
- A)
-
What is the purpose of
findin CMD piping?- A) Find files in a directory
- B) Search for text patterns within output
- C) Find a string to copy to clipboard
- D) Find which shell to use
-
Which key allows you to autocomplete a path in CMD?
- A)
Ctrl + A - B)
Ctrl + E - C)
Tab - D)
Space
- A)
-
How do you copy text to the Windows clipboard from CMD?
- A)
type filename > clipboard - B)
type filename | clip - C)
copy filename - D)
type filename | paste
- A)
-
What does
where openscaddo?- A) Opens the OpenSCAD application
- B) Gets help about the openscad command
- C) Locates the full path of the openscad executable
- D) Lists all available commands
-
Which wildcard matches any single character?
- A)
* - B)
? - C)
% - D)
#
- A)
-
What is the purpose of the
startcommand?- A) Run a script or executable, optionally in a new window
- B) Execute all commands in parallel
- C) Combine multiple commands
- D) Create an alias
-
How do you create a temporary alias (macro) in CMD?
- A)
alias preview='openscad' - B)
doskey preview=openscad $* - C)
set preview=openscad - D)
macro preview openscad
- A)
-
How can doskey macros be made to persist across CMD sessions?
- A) They are automatically saved
- B) By adding them to a startup batch script registered as an autorun
- C) By using the Windows Control Panel
- D) Doskey macros cannot be made permanent
-
How do you abort a long-running command in CMD?
- A) Press
Escape - B) Press
Ctrl + X - C) Press
Ctrl + C - D) Press
Alt + F4
- A) Press
-
What command shows the history of previously run commands in CMD?
- A)
history - B)
doskey /history - C)
F7(opens history popup) - D) Both B and C are correct
- A)
-
How do you make an environment variable permanent in CMD (for all future sessions)?
- A) Use
setin the terminal every time - B) Use
setxto write it to the registry - C) Use the Windows Control Panel only
- D) Environment variables cannot be made permanent in CMD
- A) Use
Part B: Short Answer Questions (10 questions)
Answer each question in one to two sentences. Each question is worth 2 points.
-
Explain the difference between absolute and relative paths. Give one example of each.
-
Why is
dir /Bpreferred overdirfor screen reader users? Describe what flag you would add to list only files. -
What is the purpose of redirecting output to a file, and give an example of when you would use
>instead of>>?
Warning
rmdir /S /Q C:\Documents\my_folderpermanently deletes the folder and all its contents with no confirmation prompt and no undo. Always rundir /B C:\Documents\my_folderfirst to confirm what you’re about to destroy.
-
Describe what would happen if you ran
rmdir /S /Q C:\Documents\my_folderand why this command should be used carefully. -
How would you search for all files with a
.scadextension in your current directory? Write the command. -
Explain what happens when you pipe the output of
dir /Bintoclip. What would you do next? -
What is an environment variable, and give one example of how you might use it in CMD.
-
If a program is not in your
PATH, what two methods could you use to run it from CMD? -
Describe how you would open a file in Notepad and also add a line to it from CMD.
-
What is one strategy you would use if your screen reader stops announcing terminal output while using CMD?
Part C: Hands-On Tasks (10 tasks)
Complete each task and capture evidence (screenshots, output files, or command transcripts). Each task is worth 3 points.
Tasks 1-5: File System and Navigation
-
Create a folder structure
%USERPROFILE%\Documents\CMD_Assessment\Projectsusing a single command. Capture thedir /Boutput showing the creation. -
Create five files named
project_1.scad,project_2.scad,project_3.txt,notes_1.txt, andnotes_2.txtinside theProjectsfolder. Use wildcards to list only.scadfiles, then capture the output. -
Copy the entire
Projectsfolder toProjects_Backupusingxcopy /E /I. Capture thedir /Boutput showing both folders exist. -
Move (rename)
project_1.scadtoproject_1_final.scad. Capture thedir /Boutput showing the renamed file. -
Delete
notes_1.txtandnotes_2.txtusing a singledelcommand with wildcards. Capture the finaldir /Boutput.
Tasks 6-10: Advanced Operations and Scripting
-
Create a file called
my_data.txtwith at least four lines usingechoand>>. Then read it withtype my_data.txtand capture the output. -
Use
findto search for a keyword (e.g., “project”) inmy_data.txtand pipe the results toclip. Paste the results into Notepad and capture a screenshot. -
List all files in the
Projectsfolder and redirect the output toprojects_list.txt. Open it in Notepad and capture a screenshot of the file. -
Create a temporary
doskeyalias calledmydirthat runsdir /B, test it, and capture the output. Then explain what would be required to make it persistent. -
Run
help dirand redirect the output tohelp_output.txt. Open the file in Notepad and capture a screenshot showing at least the first page of help content.
Grading Rubric
| Section | Questions | Points Each | Total |
|---|---|---|---|
| Multiple Choice | 20 | 1 | 20 |
| Short Answer | 10 | 2 | 20 |
| Hands-On Tasks | 10 | 3 | 30 |
| Total | 40 | - | 70 |
Passing Score: 49 points (70%)
Helpful Resources for Review
- CMD Command Reference
- Navigation and File System
- Using Pipes and Filtering
- DOSKEY and Aliases
- Screen Reader Accessibility Tips
Submission Checklist
- All 20 multiple choice questions answered
- All 10 short answer questions answered (1-2 sentences each)
- All 10 hands-on tasks completed with evidence captured
- Files/screenshots organized and labeled clearly
- Submission includes this checklist
Part 3 — Git Bash
Last Updated: February 2026
Total Duration: 30–45 hours of instruction and practice (for screen reader users)
Target Users: Anyone using a screen reader — NVDA, JAWS, Windows Narrator, and Dolphin SuperNova are all covered throughout this curriculum.
Platform: Git Bash on Windows (commands transfer directly to macOS Terminal and Linux)
Alternate to: PowerShell curriculum and CMD curriculum (same concepts, Bash/Unix syntax)
This single file contains the complete Git Bash Foundation curriculum in reading order. All lessons, quizzes, extension problems, and the unit exam are included. No additional files are needed.
Table of Contents
| Section | Title | Estimated Time |
|---|---|---|
| Screen Reader Accessibility Guide | NVDA, JAWS, Narrator, and SuperNova reference for Git Bash | 1–1.5 hours |
| Tutorial: Git Bash Quick Start | Prompt orientation, core commands, path concepts | 30–45 minutes |
| Lesson Pre: Your First Terminal | Installing Git Bash, opening it, first commands | 1.5–2 hours |
| Lesson 0: Getting Started | Paths, ~, ./, ../, tab completion | 20–30 minutes |
| Lesson 1: Navigation | pwd, cd, ls and flags, wildcards | 1 class period |
| Lesson 2: File and Folder Manipulation | touch, mkdir, cp, mv, rm, rmdir | 30–45 minutes |
| Lesson 3: Input, Output, and Piping | echo, cat, >, >>, ` | , clip, grep` |
| Lesson 4: Environment Variables and Aliases | $VARNAME, PATH, which, alias, .bashrc | 30–45 minutes |
| Lesson 5: Filling in the Gaps | history, Ctrl+R, Ctrl+C, .bashrc, ./ | 30–45 minutes |
| Lesson 6: Advanced Techniques | Shell scripts, functions, loops, professional workflows | 4–4.5 hours |
| Unit Exam | Comprehensive assessment — Lessons 0 through 6 | 60–90 minutes |
Total: approximately 30–45 hours including practice exercises
How to Use This File
If you have never used a terminal before: start with the Accessibility Guide, then the Tutorial, then Lesson Pre. Read in order from the top — each lesson builds on the previous one.
If you have used a terminal (CMD or PowerShell) but not Git Bash: read the Tutorial section for the key differences (Unix paths, forward slashes, ls vs dir, cat vs type). Then start at Lesson 0.
If you are experienced with Bash on macOS or Linux: jump to the Accessibility Guide for screen-reader-specific techniques, then skip to whatever lesson covers your gap.
Reference while working: the Accessibility Guide and Tutorial contain material you will return to throughout the curriculum. Bookmark those sections.
CMD or PowerShell users: this curriculum covers the same concepts as the CMD and PowerShell curricula but uses Bash/Unix syntax. Commands learned here transfer directly to macOS Terminal and Linux. Choose one pathway and stay consistent.
Curriculum Rules (Read These First)
Important
Rule 1 — Always know where you are. Start every session with
pwd. If you don’t know your current path, you risk operating on the wrong files or folders.
Rule 1 — Always know where you are.
Every session, first thing: pwd. If you do not know your path, you will get lost.
Warning
There is no Recycle Bin in the terminal. Files deleted with
rmare permanently gone immediately — no undo, no recovery. Always runls -1to confirm exactly what you’re about to delete before running anyrmcommand.
Rule 2 — Check before you delete.
Before any rm or rm -r command: ls -1 to confirm exactly what you are about to remove. Deleted files are gone immediately — there is no Recycle Bin in the terminal.
Tip
Always use
ls -1(the number 1, not the letter L) — never barels. The-1flag outputs one name per line, which screen readers can follow reliably. Barelsoutputs a multi-column grid that is difficult to navigate audibly.
Rule 3 — Use ls -1 for listings.
Always ls -1 — never bare ls. The -1 flag gives one name per line, which all screen readers can follow reliably. (That is the number one, not the letter L.)
Tip
When output is long or confusing, redirect it to a file:
command > output.txt, then open withnotepad.exe output.txt. This is always clearer than reading raw terminal output and works with all four screen readers.
Rule 4 — When output is confusing, redirect to a file.command > output.txt then notepad.exe output.txt. This works with all four screen readers and is always clearer than reading raw terminal output.
Rule 5 — Save everything you create.
Keep all practice files in a dedicated learning folder: mkdir -p ~/Documents/GitBash_Learning
Screen Reader Accessibility Guide for Git Bash
Target Users: NVDA, JAWS, and other screen reader users
Last Updated: 2026
This guide is used throughout the Git Bash Foundation curriculum to help screen reader users navigate and work efficiently with the terminal.
Table of Contents
- Getting Started with Screen Readers
- NVDA-Specific Tips
- JAWS-Specific Tips
- General Terminal Accessibility
- Working with Long Output
- Keyboard Shortcuts Reference
- Troubleshooting
Getting Started with Screen Readers
Which Screen Reader Should I Use?
Both NVDA and JAWS work well with Git Bash, but they have different strengths:
| Feature | NVDA | JAWS |
|---|---|---|
| Cost | Free | Commercial (paid) |
| Installation | Simple | Complex but thorough |
| Git Bash Support | Excellent | Excellent |
| Learning Curve | Gentle | Steeper |
| Customization | Good | Extensive |
Recommendation: Start with NVDA if you’re new to screen readers. Both will work for this curriculum.
Additional options: Dolphin SuperNova is a commercial screen reader/ magnifier popular in some education settings; Windows Narrator is built into Windows and useful for quick access without installing additional software. Choose based on availability and personal preference.
Before You Start
- Make sure your screen reader is running before opening Git Bash
- Open Git Bash and let your screen reader read the window title and prompt
- If you don’t hear anything, press Alt+Tab to cycle windows and find Git Bash
- Use your screen reader’s screen review features to understand the layout
What is Git Bash?
Git Bash is a terminal application for Windows that provides a Unix-style command-line experience (Bash shell). It is installed as part of Git for Windows, which is free software available at https://git-scm.com/. When you open Git Bash, you get the same bash, ls, grep, cat, and other Unix tools used on Linux and macOS - but running on your Windows computer.
NVDA-Specific Tips
NVDA is free and available from https://www.nvaccess.org/
Key Commands for Git Bash
| Command | What It Does |
|---|---|
| NVDA+Home | Read the current line (your command or output) |
| NVDA+Down Arrow | Read from cursor to end of screen |
| NVDA+Up Arrow | Read from top to cursor |
| NVDA+Page Down | Read next page |
| NVDA+Page Up | Read previous page |
| NVDA+F7 | Open the Review Mode viewer (can scroll through text) |
| NVDA+Shift+Right Arrow | Read next word |
| NVDA+Shift+Down Arrow | Read entire screen |
| NVDA+End | Jump to end of line |
| NVDA+Home | Jump to start of line |
Example: Reading Long Output
Scenario: You ran ls and it listed 50 files.
Solution with NVDA:
- After the command finishes, press NVDA+Home to read the current line
- Press NVDA+Down Arrow repeatedly to read all output
- Or press NVDA+F7 to open Review Mode and use arrow keys to scroll
Tip: Use ls -1 for Screen Reader Friendly Listings
By default, ls in Git Bash may display files in columns. Use ls -1 (the number one, not the letter L) to display one file per line - much easier to follow with a screen reader.
JAWS-Specific Tips
JAWS is a commercial screen reader available from https://www.freedomscientific.com/
Dolphin SuperNova
Dolphin SuperNova (commercial): https://example.com — provides speech and braille support and tightly integrated magnification. Refer to vendor docs for keyboard mappings; many users rely on review-mode features similar to NVDA/JAWS.
Windows Narrator
Windows Narrator (built-in): https://example.com — good for quick checks and lightweight usage; Narrator command keys differ by Windows version (use Narrator key + arrow keys to read). Add Narrator to your workflow when a full third-party screen reader isn’t available.
Key Commands for Git Bash
| Command | What It Does |
|---|---|
| Insert+Down Arrow | Read line by line downward |
| Insert+Up Arrow | Read line by line upward |
| Insert+Page Down | Read next page of text |
| Insert+Page Up | Read previous page of text |
| Insert+End | Jump to end of text on screen |
| Insert+Home | Jump to start of text on screen |
| Insert+Ctrl+Down | Read to end of screen |
| Insert+Ctrl+Up | Read to beginning of screen |
| Insert+F3 | Open JAWS menu |
Example: Reading Long Output
Scenario: You ran ls > list.txt and saved output to a file.
Solution with JAWS:
- Open the file:
notepad list.txt - In Notepad, press Insert+Ctrl+Down to hear all content
- Use Insert+Down Arrow to read line by line at your own pace
General Terminal Accessibility
Understanding the Git Bash Layout
The Git Bash window contains:
- Title bar: Window name (e.g., “MINGW64:/c/Users/YourName”)
- Content area: Command history and output
- Prompt: Where you type (e.g.,
YourName@COMPUTER MINGW64 ~$)
Your screen reader reads from top to bottom, but focus is at the prompt (bottom).
The Git Bash Prompt
The default Git Bash prompt looks like:
YourName@COMPUTERNAME MINGW64 ~/Documents
$
YourName= your Windows usernameCOMPUTERNAME= your computer’s nameMINGW64= the environment type (64-bit)~/Documents= your current location$= ready for input
Note: Paths in Git Bash use forward slashes (/) and your Windows C:\Users\YourName folder appears as /c/Users/YourName or simply ~.
Navigation Sequence
When you open Git Bash:
- Your screen reader announces the window title
- Then it announces the prompt line
- Anything before the prompt is previous output
- Anything after the prompt is where new output will appear
Reading Output Effectively
Strategy 1: Immediate Output (Small Amount)
- Run a command
- Your screen reader announces output immediately
- This works well for short outputs (a few lines)
Strategy 2: Large Output (Many Lines)
- Redirect to a file:
command > output.txt - Open the file:
notepad output.txt - Read in Notepad (easier for long text)
Strategy 3: Searching Output
-
Use
grepto filter:ls | grep "pattern" -
Only results matching “pattern” are shown
Working with Long Output
Solution 1: Redirect to a File
ls -1 > list.txt
notepad list.txt
Solution 2: Use Pagination
ls | less
- Press Space to see next page
- Press Q to quit
- Note: Some screen readers struggle with
less, so Solution 1 is preferred
Solution 3: Filter Output
ls | grep "\.scad"
Solution 4: Count Before Displaying
ls | wc -l
Tells you how many items there are. If the count is over 20, use the file method.
Keyboard Shortcuts Reference
All Users (Works in Git Bash Regardless of Screen Reader)
| Key | Action |
|---|---|
| Up Arrow | Show previous command |
| Down Arrow | Show next command |
| Tab | Auto-complete file/folder names |
| Shift+Tab | Cycle backward through completions |
| Home | Jump to start of line |
| End | Jump to end of line |
| Ctrl+A | Jump to start of line (alternate) |
| Ctrl+E | Jump to end of line (alternate) |
| Ctrl+C | Stop command |
| Ctrl+L | Clear screen |
| Enter | Run command |
| Ctrl+R | Search command history interactively |
Troubleshooting
Problem 1: “I Can’t Hear the Output After Running a Command”
- Redirect to file:
command > output.txtthennotepad output.txt - Press End or Ctrl+End to go to end of text
- Use Up Arrow to review previous command
Problem 2: “Tab Completion Isn’t Working”
- Need at least one character - type
cd Dthen Tab (not justcdthen Tab) - Check if item exists - use
lsfirst to see available items - Multiple matches - press Tab twice to list all options
Problem 3: “‘Command Not Found’ Error”
- Check spelling carefully
- Git Bash uses Unix commands: use
lsnotdir, usecatnottype - Verify the program is installed and in your PATH:
which openscad
Problem 4: “Paths Look Weird”
Git Bash converts Windows paths to Unix style:
- Windows:
C:\Users\YourName\Documents - Git Bash:
/c/Users/YourName/Documentsor~/Documents
Both refer to the same location. When opening files in Windows apps (like Notepad), you may need to use the Windows path format.
Problem 5: “Command Runs Forever and Won’t Stop”
Press Ctrl+C
Problem 6: “I Need to Edit My Last Command”
- Press Up Arrow to show previous command
- Use arrow keys to move through it
- Edit the command
- Press Enter to run the modified version
Pro Tips for Efficiency
1. Use ls -1 for Screen Reader Friendly Listings
ls -1
One file per line - much easier to follow with a screen reader.
2. Create Aliases for Frequently Used Commands
alias la='ls -1a'
Add this to your ~/.bashrc file to make it permanent.
3. Use Command History Effectively
history
Run a previous command by number:
!5
(Runs the 5th command in history)
Or search history interactively:
# Press Ctrl+R then type part of a previous command
4. Redirect Everything to Files for Accessibility
command-name > results.txt
notepad results.txt
5. Create a README for Yourself
echo "ls -1 means list files one per line (screen reader friendly)" > my-notes.txt
echo "cd means change directory" >> my-notes.txt
notepad my-notes.txt
Recommended Workflow
For every new task:
- Know where you are:
pwd - See what’s around:
ls -1 - Plan your next step: Think before typing
- Run the command: Type and press Enter
- Check the output: Use screen reader or redirect to file
- Move forward: Next command or
cdto next folder
Quick Reference Card
EVERY COMMAND STARTS WITH:
1. pwd (where am I?)
2. ls -1 (what's here?)
3. cd path (go there)
LONG OUTPUT?
-> command > file.txt
-> notepad file.txt
STUCK?
-> Ctrl+C
WANT TO REPEAT?
-> Up Arrow
-> history
NEED HELP?
-> man command-name (or: command --help)
Additional Resources
- NVDA Documentation: https://www.nvaccess.org/documentation/
- JAWS Documentation: https://www.freedomscientific.com/support/
- Git for Windows (includes Git Bash): https://git-scm.com/
- Bash Manual: https://www.gnu.org/software/bash/manual/
Tutorial: Git Bash Quick Start
Estimated time: 30-45 minutes
Learning Objectives
- Launch Git Bash and identify the prompt
- Understand and use basic path notation (
~,./,../) - Use
pwd,ls -1, andcdto navigate the filesystem - Open files in an external editor and run simple commands
Materials
- A computer with Git Bash installed (install via https://git-scm.com/)
- Access to a text editor (Notepad, VS Code)
Pre-Requisite Knowledge
- Typing and basic text-editing skills
- Familiarity with file/folder concepts and basic OS navigation
- Basic screen-reading familiarity (if applicable)
What is Git Bash?
Git Bash is a free terminal application for Windows that provides a Bash (Unix shell) environment. It is installed as part of Git for Windows. When you open Git Bash, you can use Unix commands like ls, cat, grep, and echo - the same commands used on Linux and macOS - right on your Windows computer.
Git Bash is useful for:
- Running CLI programs (like OpenSCAD, slicers, or 3DMake)
- Navigating the filesystem with keyboard-only commands
- Automating repetitive tasks with scripts
- Accessibility: works cleanly with NVDA, JAWS, and other screen readers
What We’ll Do and Why
You’ll use Git Bash to run CLI programs, navigate the filesystem, and manipulate files - tasks that are especially efficient when using a keyboard or a screen reader.
Quick Tutorial & Core Concepts
Paths and Navigation
~- home directory (e.g.,/c/Users/YourName).- current directory..- parent directory./- current directory shortcut (used to run scripts:./script.sh)../- parent directory shortcut- Use Tab to autocomplete files and folders
Git Bash uses forward slashes (/) for paths, just like Linux. Your Windows C:\Users\YourName folder is accessible as /c/Users/YourName or simply ~.
Useful Commands (Examples)
pwd # show current directory
ls -1 # list files, one per line (screen-reader friendly)
cd path/to/dir # change directory
whoami # current user
Wildcards
*matches zero or more characters?matches a single character
Use ls *.scad to filter by extension, for example.
Common Operations
File and Folder Manipulation
mkdir my-folder # create folder
mkdir -p a/b/c # create nested folders at once
cp -r src dest # copy (use -r for directories)
mv oldname newname # rename or move
rm file # remove file
rm -r folder # remove folder and contents
touch filename.txt # create new empty file
Input, Output, and Piping
echo 'hello' | clip # copy to clipboard
command > output.txt # redirect output to file
command >> output.txt # append output to file
command > /dev/null # discard/suppress output
Use | to pipe output and > to redirect into files.
Editing and Running Programs
notepad file.txt # open in Notepad (Windows)
code file.txt # open in VS Code (if in PATH)
./script.sh # run a script in the current directory
chmod +x script.sh # make a script executable
Screen-Reader Friendly Tips
- Prefer
ls -1for name-only, one-per-line output. - Filter lists with
grep:ls -1 ~/Documents | grep "\.scad$"(files only ending in .scad). - Redirect very long outputs to a file and open it in an editor.
Error Handling and Control
- Abort a running command:
Ctrl+C - View history: Up/Down arrows or
history - Clear screen:
clear(orCtrl+L) - If an error is long, read the first few lines for the gist and copy short snippets into a file to examine.
Environment Variables & PATH
Environment variables configure your session. PATH tells the shell where to find executables.
echo $PATH
echo $HOME
echo $USER
To add a directory to PATH for the current session:
export PATH="$PATH:/path/to/my/tools"
To make it permanent, add that line to ~/.bashrc.
Running CLI Applications and Archives
To extract ZIP archives in Git Bash:
# Unzip a file
unzip file.zip -d destinationfolder
# Or use Windows' built-in tool (from Git Bash):
powershell.exe Expand-Archive -Path file.zip -DestinationPath folder
Aliases and Cross-Platform Notes
Git Bash provides Unix commands that work identically on Linux and macOS. This means your Git Bash skills transfer directly if you ever work on a Mac or Linux system.
Useful aliases to add to ~/.bashrc:
alias ll='ls -la'
alias la='ls -1a'
alias ..='cd ..'
alias ...='cd ../..'
Step-by-step Tasks (Hands-On)
- Open Git Bash; listen for the prompt and current path.
- Run
pwdto confirm your location. - Run
ls -1in your home directory and note the output. - Practice
cd Documents,cd ../, andcd ~to move between folders. - Create and open a file:
touch example.txt && notepad example.txt(orcode example.txt).
Checkpoints
- After step 3 you should be able to state your current directory.
- After step 5 you should be able to create and open a text file from Git Bash.
Quick Quiz (10 questions)
- What command prints your current directory?
- What does
~represent? - How do you list only names, one per line?
- How do you go up one directory level?
- How would you open
notes.txtin Notepad from Git Bash? - True or False: The pipe operator
|sends output to a file. - Explain why running a script requires
chmod +xfirst. - What is the difference between running a script with
./script.shversusbash script.sh? - Describe how you would handle a very long command output when using a screen reader.
- What does the
PATHenvironment variable do, and why is it important when running programs like OpenSCAD?
Extension Problems
- Create a folder
OpenSCADProjectsin Documents and verify its contents. - Create three files named
a.scad,b.scad,c.scadand list them with a wildcard. - Save
ls -1 ~/Documentsoutput todoclist.txtand open it. - Try tab-completion in a deeply nested folder and note behavior.
- Capture
pwdoutput into a file and open it:pwd > cwd.txt && notepad cwd.txt. - Build an automated setup script that creates a complete project directory structure, initializes placeholder files, and generates a README.
- Create a Git Bash cheat sheet for your most-used commands; organize by category (navigation, files, scripting, troubleshooting).
- Write a non-visual tutorial for Git Bash basics; use audio descriptions and keyboard-only navigation as the primary learning method.
- Develop a workflow automation script: combines multiple Git Bash concepts (folders, aliases, piping) to solve a real 3D printing task.
- Create a Git Bash proficiency self-assessment: list all concepts covered, provide test commands for each, and reflect on what you learned.
References
- Git for Windows. (2024). Git Bash. https://gitforwindows.org/
- GNU. (2024). Bash reference manual. https://www.gnu.org/software/bash/manual/bash.html
- The Linux Documentation Project. (2024). Bash Beginners Guide. https://tldp.org/LDP/Bash-Beginners-Guide/html/
Helpful Resources
Other Screen Readers
Dolphin SuperNova (commercial) and Windows Narrator (built-in) are also supported; the workflows and recommendations in this document apply to them. See https://example.com and https://example.com for vendor documentation.
Lesson Pre: Your First Terminal — Screen Reader Navigation Fundamentals
Duration: 1.5-2 hours (for screen reader users)
Prerequisites: None - this is the starting point
Accessibility Note: This lesson is designed specifically for screen reader users (NVDA, JAWS)
Important
Git Bash uses Unix/bash commands, different from Windows CMD/PowerShell
What is Git Bash?
Git Bash is a Unix/Linux shell running on Windows. It gives you bash commands (same as macOS and Linux) while staying on your Windows computer.
Why learn this?
- Faster and more precise work (especially for 3D printing scripts and automation)
- Essential for programming and using tools like OpenSCAD
- Accessibility: Git Bash works perfectly with screen readers
- Transferable: Same commands work on macOS and Linux
- Industry-standard: Professional developers use this everywhere
Installing and Opening Git Bash
3DMake: Your First Real-World Goal
3DMake (github.com/tdeck/3dmake) is a free, accessibility-first command-line tool for designing and 3D-printing models entirely from the terminal — no mouse required. Every Git Bash skill in this curriculum directly supports a real 3DMake workflow.
Here is the end goal — one command that builds your OpenSCAD model, slices it, and sends it to the printer:
# Navigate to your project folder
cd ~/Documents/3d_projects/my_cube
# Build, slice, and print in a single command
3dm build slice print
Keep this goal in mind as you work through each lesson.
Installing and Opening Git Bash
Installation (If Not Already Installed)
- Download from: https://git-scm.com/download/win
- Run the installer
- Accept defaults (all options work fine)
- Installation takes ~5 minutes
Opening Git Bash
Method 1: Search (Easiest)
- Press the Windows key alone
- You should hear “Search”
- Type:
Git Bash - You’ll hear search results appear
- Press Enter to open
Method 2: From File Explorer
- Open File Explorer
- Navigate to any folder
- Right-click on the folder
- Look for “Git Bash Here”
- Press Enter
First Connection: Understanding the Prompt
When Git Bash opens, your screen reader will announce the window title and then the prompt.
What you’ll hear (typical example):
user@computer MINGW64 ~
$
What this means:
user= Your username@computer= Your computer nameMINGW64= Version of Git Bash~= Your current location (home directory)$= The prompt is ready for your input
Important
Your cursor is blinking right after the
$. This is where you type.
Your First Commands (Screen Reader Edition)
Command 1: “Where Am I?” - pwd
What it does: Tells you your current location
Type this:
pwd
Press Enter
What you’ll hear: Your screen reader will announce the current path, something like:
/c/Users/YourName
Understanding paths in Git Bash:
- Paths use forward slashes:
/c/Users/YourName/Documents /c/means the C: drive (Windows drive)- This is Unix-style, same as macOS and Linux
- Think of it like folders inside folders:
/c/(main drive) ->Users->YourName->Documents
Command 2: “What’s Here?” - ls
What it does: Lists all files and folders in your current location
Type this:
ls
Press Enter
What you’ll hear: Your screen reader will announce a list of file and folder names, one per line. Perfect for screen readers!
Command 3: “Go There” - cd Documents
What it does: Changes your location (navigates to a folder)
Type this:
cd Documents
Press Enter
What you’ll hear: The prompt changes to show your new location. You might hear something like:
user@computer MINGW64 ~/Documents
$
Practice navigation:
- Run
pwdto confirm you’re in Documents - Run
lsto see what files are in Documents - Try going back:
cd ..(the..means “go up one level”) - Run
pwdagain to confirm - Go back to Documents:
cd Documents
Creating and Viewing Files
Create a Simple File
Type this:
echo "Hello, Git Bash!" > hello.txt
What this does:
echosends text to the screen (or file)"Hello, Git Bash!"is the text>redirects it to a file calledhello.txt
Read the File Back
Type this:
cat hello.txt
What you’ll hear: Your screen reader announces:
Hello, Git Bash!
Open and Edit the File
Type this:
notepad.exe hello.txt
This opens the file in Notepad where you can edit it with your screen reader.
Essential Keyboard Shortcuts
These work in Git Bash and are crucial for screen reader users:
| Key Combination | What It Does |
|---|---|
| Up Arrow | Shows your previous command (press again to go further back) |
| Down Arrow | Shows your next command (if you went back) |
| Tab | Auto-completes folder/file names |
| Ctrl+C | Stops a running command |
| Ctrl+L | Clears the screen |
| Ctrl+A | Go to beginning of line |
| Ctrl+E | Go to end of line |
| Enter | Runs the command |
Screen reader tip: These all work perfectly with your screen reader. Try them!
Screen Reader-Specific Tips
NVDA Users
-
Reading Command Output:
- Use NVDA+Home to read the current line
- Use NVDA+Down Arrow to read to the end of the screen
- Use NVDA+Page Down to read the next page
-
Reviewing Text:
- Use NVDA+Shift+Page Up to review text above
JAWS Users
-
Reading Output:
- Use Insert+Down Arrow to read line-by-line
- Use Insert+Page Down to read by page
- Use Insert+End to jump to the end of text
-
Reading All Text:
- Use Insert+Down Arrow repeatedly
- Or use Insert+Ctrl+Down to read to the end
Common Issue: “I Can’t Hear the Output”
Problem: You run a command but don’t hear the output
Solutions:
- Make sure your cursor is at the prompt (try pressing End or Ctrl+E)
- Use Up Arrow to go back to your previous command and review it
- Try redirecting to a file:
command > output.txtthen open the file - In NVDA: Try pressing NVDA+F7 to open the Review Mode viewer
Practice Exercises
Complete these in order. Take your time with each one:
Exercise 1: Basic Navigation
- Open Git Bash
- Run
pwdand note your location - Run
lsand listen to what’s there - Try
cd Documentsor another folder - Run
pwdto confirm your new location - Run
lsin this new location
Goal: You should be comfortable knowing where you are and what’s around you
Exercise 2: Using Tab Completion
- In your home directory, type
cd D(just the letter D) - Press Tab
- Git Bash should auto-complete to a folder starting with D
- Repeat with other folder names
- Try typing a longer name:
cd Downand Tab
Goal: Tab completion should feel natural
Exercise 3: Creating and Viewing Files
- Create a file:
echo "Test content" > test.txt - View it:
cat test.txt - Create another:
echo "Line 2" > another.txt - List both:
ls *.txt
Goal: You understand create, view, and list operations
Exercise 4: Going Up Levels
- Navigate into several folders:
cd Documents, thencd folder1, etc. - From deep inside, use
cd ..multiple times to go back up - After each
cd .., runpwdto confirm your location
Goal: You understand relative navigation with ..
Exercise 5: Redirecting Output
- Create a list:
ls > directorylist.txt - Open it:
notepad.exe directorylist.txt - Read it with your screen reader
- Close Notepad
- Verify the file exists:
ls | grep directory
Goal: You can save long outputs to files for easier reading
Checkpoint Questions
After completing this lesson, you should be able to answer:
- What does
pwddo? - What does
lsdo? - Why do we use
lsfor listings? - What path are you in right now?
- How do you navigate to a new folder?
- How do you go up one level?
- What’s the Tab key for?
- What does
echo "text" > file.txtdo? - How do you read a file back?
- How do you stop a command that’s running?
You should be able to answer all 10 with confidence before moving to Bash Lesson 0.
Common Questions
Q: Is Git Bash the same as Command Prompt or PowerShell? A: No. Git Bash uses Unix/bash commands. CMD and PowerShell use Windows commands. This curriculum teaches bash (Unix) style.
Q: Why is my screen reader not reading the output?
A: This is common. Use command > file.txt to save output to a file, then open it with Notepad for reliable reading.
Q: What if I type something wrong? A: Just press Enter and you’ll see an error message. Type the correct command on the next line. No harm done!
Q: How do I get help with a command?
A: Type man command-name (we’ll cover this in Bash Lesson 0)
Q: Why do paths look different in Git Bash? A: Git Bash uses Unix-style paths with forward slashes, not Windows backslashes. Don’t worry - you’ll get used to it quickly.
Path Comparison: Windows vs Git Bash
| Style | Example | Where Used |
|---|---|---|
| Windows | C:\Users\Name\Documents | CMD, PowerShell, Windows Explorer |
| Git Bash | /c/Users/Name/Documents | Git Bash, macOS Terminal, Linux |
In Git Bash:
C:\becomes/c/- Backslashes
\become forward slashes/ - Otherwise identical
Next Steps
Once you’re comfortable with these basics:
- Move to Bash Lesson 0: Getting Started for deeper path understanding
- Then continue through Bash Lesson 1 through Bash Lesson 5 for full terminal mastery
Resources
- Git Bash Installation Guide: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
- Bash Basics: https://www.gnu.org/software/bash/manual/bash.html#Basic-Shell-Features
- NVDA Screen Reader: https://www.nvaccess.org/
- JAWS Screen Reader: https://www.freedomscientific.com/products/software/jaws/
Troubleshooting
| Issue | Solution |
|---|---|
| Git Bash won’t open | Make sure it’s installed; search for “Git Bash” in Start menu |
| Can’t hear the output | Try redirecting to a file: command > output.txt |
| Tab completion not working | Make sure you typed at least one character before pressing Tab |
| Command not found | Make sure you spelled it correctly; try man for available commands |
| Stuck in a command | Press Ctrl+C to stop it |
Still stuck? The checkpoint questions and exercises are your best teacher. Work through them multiple times until comfortable.
Other Screen Readers
Dolphin SuperNova (commercial) and Windows Narrator (built-in) are also supported; the workflows and recommendations in this document apply to them. See https://yourdolphin.com/supernova/ and https://support.microsoft.com/narrator for vendor documentation.
Lesson 0: Getting Started — Layout, Paths, and the Shell
Estimated time: 20-30 minutes
Learning Objectives
- Launch Git Bash and locate the prompt
- Understand Unix-style path notation and shortcuts (
~,./,../) - Use tab completion to navigate quickly
Materials
- Computer with Git Bash installed
- Editor (Notepad/VS Code)
Step-by-step Tasks
- Open Git Bash and note the prompt (it includes the current path).
- Run
pwdand say or note the printed path. - Use
lsto list names in your home directory. - Practice
cd Documents,cd ../andcd ~until comfortable. - Try tab-completion: type
cd ~/Dand press Tab.
Checkpoints
- Confirm you can state your current path and move to
Documents.
Quiz - Lesson GitBash.0
3DMake Quick-Start: Your First Real Project
You now know enough Git Bash to set up a real 3DMake project. Do this now — it is the fastest path to a printed object.
Step 1 — Download and run the 3DMake setup wizard:
# Go to your Downloads folder (where you extracted 3dmake)
cd ~/Downloads/3dmake
# Run the guided setup (answer the questions about your printer)
./3dm setup
Step 2 — Create your first project:
# Create a folder for all your 3D projects and initialize the first one
mkdir -p ~/Documents/3d_projects/my_cube
cd ~/Documents/3d_projects/my_cube
3dm new
Step 3 — Confirm the project structure:
# You should see three items: src/, build/, and 3dmake.toml
ls -1
You just used mkdir, cd, and ls -1 on a real project. You are ready to print.
Checkpoints
- Confirm you can state your current path and move to
Documents.
Quiz - Lesson GitBash.0
- What is a path?
- What does
~mean? - How do you autocomplete a path?
- How do you go up one directory?
- What command lists file names?
Note
Git Bash uses forward slashes (
/) in paths, not Windows-style backslashes (\). For example:/c/Users/YourName/Documents. This is the Unix convention and transfers directly to macOS and Linux.
- True or False: Git Bash uses backslashes (
\) in paths like Windows CMD. - Explain the difference between an absolute path and a relative path.
- If you are in
/c/Users/YourName/Documentsand you typecd ../, where do you end up? - What happens when you press Tab while typing a folder name in Git Bash?
- Describe a practical reason why understanding paths is important for a 3D printing workflow.
- What does
./mean in a path, and when would you use it?
Note
When a folder name contains spaces, always wrap the full path in double quotes:
cd "My Projects". Without quotes, the shell interprets the space as a separator between two separate arguments.
- If a folder path contains spaces (e.g.,
My Projects), how do you navigate to it withcd? - Explain what the prompt
YourName@COMPUTER MINGW64 ~/Documents $tells you about your current state. - How would you navigate to your home directory from any location using a single command?
- What is the advantage of using relative paths (like
../) versus absolute paths in automation scripts?
Extension Problems
- Create a nested folder and practice
cdinto it by typing partial names and using Tab. - Use
ls -lato list all files including hidden ones in a folder. - Save
pwdoutput to a file and open it in Notepad. - Try
cdinto a folder whose name contains spaces; observe how quotes are handled. - Create a short note file and open it from Git Bash.
- Build a folder structure that mirrors your project organization; navigate to each level and document the path.
- Create a script that prints your current path and the total number of files in it; run it from different locations.
- Investigate special paths (e.g.,
$HOME,$USER); write down what each contains and when you’d use them. - Compare absolute vs. relative paths by navigating to the same folder using each method; explain which is easier for automation.
- Create a bash function that changes to a frequently-used folder and lists its contents in one command; test it from different starting locations.
- Navigate to three different locations and at each one note the prompt, the path from
pwd, and verify you understand what each shows. - Create a complex folder tree (at least 5 levels deep) and navigate it using only relative paths; verify your location at each step.
- Document all shortcuts you know (
~,./,../,$HOME) and demonstrate each one works as expected. - Write a guide for a peer on how to understand the Git Bash prompt and path notation without using GUI file explorer.
- Create a troubleshooting flowchart: if someone says “I don’t know where I am,” what commands do you give them to find out?
References
- GNU. (2024). Bash Manual. https://example.com
- Git SCM. (2024). Git Bash documentation. https://example.com
- Linux Foundation. (2024). The Linux Command Line. https://example.com
Helpful Resources
- Bash Manual - Navigation
- Git Bash Basics
- Linux Path Guide
- Understanding Bash Prompts
- Tab Completion in Bash
Lesson 1: Navigation — Moving Around Your File System
Duration: 1 class period Prerequisite: Bash Lesson 0 (Getting Started)
Learning Objectives
By the end of this lesson, you will be able to:
- Use
pwdto print your current location - Use
cdto move between directories - Use
ls(and its flags) to list files and folders - Use wildcards
*and?to filter listings - Navigate relative vs. absolute paths
- Search for files by name and extension
Materials
- Git Bash
- Text editor (Notepad or VS Code)
Commands Covered in This Lesson
| Command | What It Does |
|---|---|
pwd | Print Working Directory - shows where you are |
cd path | Change Directory - move to a new location |
ls | List - shows files and folders in current location |
ls -1 | List names only, one per line (screen reader friendly) |
ls -1 -F | List names with type indicators (/ for directories) |
ls *.extension | List files matching a pattern |
pwd - Where Am I?
Type pwd and press Enter. Git Bash prints the full path to your current location.
pwd
# Output: /c/Users/YourName
When to use: Always run this if you’re unsure of your current location.
cd - Changing Directories
cd stands for “change directory.”
# Go to Documents
cd Documents
# Go up one level to parent directory
cd ..
# Go to root of file system
cd /
# Go to home directory
cd ~
# Go to a specific path
cd /c/Users/YourName/Documents/3D_Projects
# Go to previous directory
cd -
ls - Listing Files and Folders
Use ls -1 for screen reader compatibility — names only, one per line.
# List all files and folders (names only, one per line)
ls -1
# List only files (no hidden, no directories)
ls -1 -p | grep -v /
# List only directories
ls -1 -d */
Wildcards - Finding Files by Pattern
Wildcards help you find files without typing the full name.
* (asterisk) matches any number of characters:
# List all .scad files
ls *.scad
# List all files starting with "part"
ls part*
# List all files ending with "_final"
ls *_final*
? (question mark) matches exactly one character:
# Find files like model1.scad, model2.scad (but not model12.scad)
ls model?.scad
Step-by-step Practice
- Run
pwdand confirm your location - Move to
Documents:cd Documents
3DMake in Practice: Navigating a Project
Navigation commands are exactly what you need to explore and manage 3DMake projects:
# Go to your project root
cd ~/Documents/3d_projects/my_cube
# See the project layout: src/, build/, 3dmake.toml
ls -1
# Enter the source folder where your .scad model files live
cd src
ls -1
# Open the main model in your text editor
3dm edit-model
# Go back to project root, then check build output
cd ..
cd build
ls -1 *.stl
# Return to project root
cd ..
# Use wildcards to find all projects with "cube" in the name
ls -1 ~/Documents/3d_projects/*cube*
Tab completion makes navigation fast: type cd ~/Doc and press Tab.
Step-by-step Practice
- Run
pwdand confirm your location - Move to
Documents:cd Documents - Confirm you moved:
pwd - List files and folders:
ls -1 - List only files:
ls -1 -p | grep -v / - Go back up:
cd .. - Search for files:
ls *.txt
Checkpoints
After this lesson, you should be able to:
- Navigate to any folder using
cd - Confirm your location with
pwd - List files and folders with
ls -1 - Use wildcards to find files by pattern
- Move between absolute and relative paths confidently
Quiz - Lesson GitBash.1
- What does
pwdshow? - How do you list directories only with
ls? - What wildcard matches any number of characters?
- How do you list files with the
.scadextension? - Give an example of an absolute path and a relative path.
- True or False: The
*wildcard matches exactly one character. - Explain the difference between
ls -1andls -1 -d */. - Write a command that would list all
.txtfiles in your Documents folder using a wildcard. - How would you search for files containing “part” in their name across multiple files?
- Describe a practical scenario where using wildcards saves time in a 3D printing workflow.
- What happens when you use
ls model?.scadversusls model*.scad? - How would you navigate to a folder whose name contains both spaces and special characters?
- If you’re in
~/Documents/Projects/3Dand you want to go to~/Documents/Resources, what command would you use? - Write a command sequence that navigates to the Downloads folder, lists only files, then returns to home.
- Explain the purpose of using
ls -1specifically in a screen reader context.
Extension Problems
- Write a one-line command that lists
.scadfiles and saves toscad_list.txt. - Use
ls -1 ~/Documents | lessto page through long listings. - Combine
lswithgrepto search for a filename pattern. - Create a shortcut alias in the session for a long path and test it.
- Practice tab-completion in a directory with many similarly named files.
- Build a bash script that recursively lists all
.scadand.stlfiles in a directory tree; save the results to a file. - Compare the output of
ls,ls -1,ls -la, andls -1 -d */to understand the flags; document what each command does. - Create a filtering command that displays only files modified in the last 7 days; test it on your documents folder.
- Write a non-visual guide to Git Bash navigation; include descriptions of common patterns and how to verify directory contents audibly.
- Develop a navigation workflow for a typical 3D printing project: move between CAD, slicing, and print-log folders efficiently; document the commands.
- Create a complex wildcard search: find all files in a folder and subfolders that match multiple patterns (e.g.,
*_v1.*or*_final.*). - Build a script that navigates through a folder tree, counts files at each level, and reports the structure.
- Document the output differences between
ls,ls -1,ls -la, andls -1 -d */; explain when to use each. - Create a navigation “cheat sheet” as a bash script that prints common paths and how to navigate to them.
- Design a project folder structure on your computer, document each path, then create a script that validates all folders exist.
References
- GNU. (2024). ls command reference. https://example.com
- GNU. (2024). Bash wildcards and globbing. https://example.com
- GNU. (2024). Navigation best practices in Bash. https://example.com
Helpful Resources
- ls Command Reference
- Bash Wildcards and Globbing
- Navigation Best Practices
- Relative and Absolute Paths in Bash
- Screen Reader Tips for Git Bash
Lesson 2: File and Folder Manipulation
Estimated time: 30-45 minutes
Learning Objectives
- Create, copy, move, and delete files and folders from Git Bash
- Use
touch,mkdir,cp,mv,rm, andrmdirsafely - Understand when operations are permanent and how to confirm results
Materials
- Git Bash
- Small practice folder for exercises
Step-by-step Tasks
- Create a practice directory:
mkdir ~/Documents/GitBash_Practiceandcdinto it. - Create two files:
touch file1.txtandtouch file2.txt. - Copy
file1.txttofile1_backup.txtwithcpand confirm withls -1. - Rename
file2.txttonotes.txtusingmvand confirm. - Delete
file1.txtwithrmand verify the backup remains.
Checkpoints
- After step 3 you should see both the original and the backup file.
3DMake in Practice: Organizing Your Projects
File management commands are essential for 3DMake project organization:
# Create a new project from scratch
mkdir -p ~/Documents/3d_projects/bottle_cap
cd ~/Documents/3d_projects/bottle_cap
3dm new
# Back up a working project before making big changes
cd ~/Documents/3d_projects
cp -r bottle_cap bottle_cap_backup
# Rename the main model file to something more specific
cd bottle_cap/src
mv main.scad bottle_cap.scad
# List only .scad files to confirm the rename
ls -1 *.scad
# Delete a draft STL you no longer need
rm ~/Documents/3d_projects/bottle_cap/build/draft.stl
# Build the renamed model (using the -m flag to specify the name)
cd ~/Documents/3d_projects/bottle_cap
3dm build -m bottle_cap
# See the fresh output in the build folder
ls -1 build/
Checkpoints
- After step 3 you should see both the original and the backup file.
Quiz - Lesson GitBash.2
- How do you create an empty file from Git Bash?
- What command copies a file?
- How do you rename a file?
- What does
rm -rdo?
Warning
rmpermanently deletes files with no undo and no Recycle Bin. There is no recovery from Git Bash. Always runls -1first to confirm exactly what you’re targeting, especially when using wildcards.
- Why is
rmpotentially dangerous? - True or False:
cprequires the-rflag to copy both files and folders. - Explain the difference between
rmandrmdir. - If you delete a file with
rm, can you recover it from Git Bash? - Write a command that would copy an entire folder and all its contents to a new location.
- Describe a practical safety check you would perform before running
rm -ron a folder. - What happens if you
cpa file to a destination where a file with the same name already exists? How would you handle this safely? - Compare
mv old_name.txt new_name.txtvsmv old_name.txt ~/Documents/new_name.txt. What is the key difference? - Design a workflow to safely delete 50 files matching the pattern
*.bakfrom a folder containing 500 files. What commands and verifications would you use? - Explain how you could back up all
.scadfiles from a project folder into a timestamped backup folder in one command. - When organizing a 3D printing project, you need to move completed designs to an archive folder and delete failed prototypes. How would you structure this as a safe, auditable process?
Extension Problems
- Create a folder tree and copy it to a new location with
cp -r. - Write a one-line command that creates three files named
a,b,cand lists them. - Move a file into a new folder and confirm the move.
- Use wildcards to delete files matching a pattern in a safe test folder.
- Export a listing of the practice folder to
practice_listing.txt. - Create a backup shell script that copies all
.scadfiles from your project folder to a backup folder with timestamp naming. - Build a safe deletion workflow: list files matching a pattern, verify count, then delete with confirmation; document the steps.
- Write a bash script that organizes files by extension into subfolders; test it on a sample folder tree.
- Create a file operation audit trail: log all copy, move, and delete operations to a text file for review.
- Develop a project template generator: a bash script that creates a standard folder structure for a new 3D printing project with essential subfolders.
- Implement a file conflict handler: write a bash script that handles cases where
cpwould overwrite an existing file by renaming the existing file with a timestamp before copying. - Create a batch rename operation: use a script to rename all files in a folder from
old_prefix_*tonew_prefix_*; test with actual files and verify the results. - Build a folder comparison tool: list all files in two folders and identify which files exist in one but not the other; output to a report.
- Write a destructive operation validator: before executing
rm -r, create a script that lists exactly what will be deleted, shows file counts by type, and requires explicit user confirmation to proceed. - Design a complete project lifecycle workflow: create folders for active projects, completed designs, and archive; include move operations between folders, backup steps, and verification that all files arrive intact.
References
- GNU. (2024). touch command reference. https://example.com
- GNU. (2024). cp and mv commands. https://example.com
- GNU. (2024). File system operations guide. https://example.com
Helpful Resources
- touch Command Reference
- cp Command Reference
- mv Command Reference
- rm Command Reference
- Safe Deletion Practices
Lesson 3: Input, Output, and Piping
Duration: 1 class period Prerequisite: Bash Lesson 2 (File and Folder Manipulation)
Learning Objectives
By the end of this lesson, you will be able to:
- Use
echoto print text to the screen - Use
catto read file contents - Use
>to redirect output into a file - Use
|(pipe) to send one command’s output to another - Copy output to the clipboard with
clip - Open files with a text editor from the command line
Commands Covered
| Command | What It Does |
|---|---|
echo "text" | Print text to the screen |
cat filename | Print the contents of a file |
> filename | Redirect output into a file (overwrites) |
>> filename | Append output to a file (adds to end) |
| | Pipe - send output from one command to the next |
clip | Copy piped input to the Windows clipboard (Git Bash) |
notepad.exe filename | Open a file in Notepad |
echo - Printing Text
echo prints text to the screen. It is useful for testing, for writing text into files, and for understanding how piping works.
echo "Hello, World"
echo "This is a test"
cat - Reading Files
cat prints the contents of a file to the screen.
# Read a text file
cat ~/Documents/notes.txt
# Read an OpenSCAD file
cat ~/Documents/OpenSCAD_Projects/project0.scad
With a long file, use cat filename | less to read it page by page (press Space to advance, Q to quit).
> - Redirecting Output to a File
The > symbol redirects output from the screen into a file instead.
# Create a file with a single line
echo "Author: Your Name" > header.txt
# Confirm the file was created and has content
cat header.txt
Warning: > overwrites the file if it already exists. Use >> to append instead:
echo "Date: 2025" >> header.txt
echo "Project: Floor Marker" >> header.txt
cat header.txt
| - Piping
The pipe symbol | sends the output of one command to the input of the next. This lets you chain commands together.
# List files and send the list to clip (copies to clipboard)
ls -1 | clip
## 3DMake in Practice: Capturing Build Output
Piping and redirection are essential for working with 3DMake's output accessibly:
```bash
# Build and save the full log to a file so you can read it
3dm build > build_log.txt
cat build_log.txt
# Build and slice, keeping only lines with errors or warnings
3dm build slice 2>&1 | grep -i "error\|warning"
# List all STL files produced so far
ls -1 build/*.stl
# Get a list of available printer profiles and save for reference
3dm list-profiles > profiles.txt
cat profiles.txt
# Get a list of material overlays (PLA, PETG, supports, etc.)
3dm list-overlays > overlays.txt
cat overlays.txt
# Get an AI description of your model, then copy to clipboard
3dm info > model_description.txt
cat model_description.txt | clip
# List files and send the list to clip (copies to clipboard)
ls -1 | clip
# Now paste with Ctrl + V anywhere
# Search within a file's contents using grep
cat project0.scad | grep "cube"
clip - Copying to Clipboard
clip takes whatever is piped to it and puts it on the Windows clipboard.
# Copy your current directory path to the clipboard
pwd | clip
# Copy a file listing to clipboard
ls -1 | clip
# Copy the contents of a file to clipboard
cat notes.txt | clip
After any of these, press Ctrl + V in any application to paste.
Opening Files in Notepad
# Open a file in Notepad
notepad.exe ~/Documents/notes.txt
# Open a .scad file
notepad.exe ~/Documents/OpenSCAD_Projects/project0.scad
# Create a new file and open it
touch new_notes.txt
notepad.exe new_notes.txt
Step-by-step Tasks
- Create
practice.txtwith three lines usingechoand>/>>. - Read the file with
cat practice.txt. - Pipe the file into
grepto search for a word. - Copy the file contents to clipboard with
cat practice.txt | clip. - Redirect
ls -1intolist.txtand open it in Notepad.
Checkpoints
- After step 3 you should be able to find a keyword using piping.
Quiz - Lesson GitBash.3
- What is the difference between
>and>>? - What does the pipe
|do? - How do you copy output to the clipboard?
- How would you page through long output?
- How do you suppress output (send it to
/dev/null)? - True or False: The pipe operator
|connects the output of one command to the input of another. - Explain why redirecting output to a file is useful for screen reader users.
- Write a command that would search for the word “sphere” in all
.scadfiles in a directory. - How would you count the number of lines in a file using bash piping?
- Describe a practical scenario in 3D printing where you would pipe or redirect command output.
- What would be the difference in output between
echo "test" > file.txt(run twice) vsecho "test" >> file.txt(run twice)? Show the expected file contents. - Design a three-step piping chain: read a file, filter for specific content, and save the results; explain what each pipe does.
- You have a 500-line
.scadfile and need to find all instances ofsphere()and count them. Write the command. - Explain how
clipis particularly valuable for screen reader users when working with file paths or long output strings. - Describe how you would use pipes and redirection to create a timestamped backup report of all
.stlfiles in a 3D printing project folder.
Extension Problems
- Use piping to count lines in a file (hint:
cat file.txt | wc -l). - Save a long
ls -1output and search it withgrep. - Chain multiple pipes to filter and then save results.
- Practice copying different command outputs to clipboard and pasting.
- Create a small bash script that generates a report (counts of files by extension).
- Build a data processing pipeline: read a text file, filter rows, and export results; document each step.
- Write a script that pipes directory listing to count occurrences of each file extension; create a summary report.
- Create a log analysis command: read a log file, filter for errors, and save matching lines to a separate error log.
- Design a piping workflow for 3D printing file management: find
.stlfiles, extract their names, and generate a report. - Develop a reusable piping function library: create bash functions for common filtering, sorting, and reporting patterns; test each with different inputs.
- Build a complex filter pipeline: read a
.scadfile, extract lines containing specific geometry commands, count each type, and output a summary to both screen and file. - Create an interactive filtering tool: build a bash script that accepts a search term, pipes through multiple filters, and displays paginated results.
- Develop a performance analysis tool: use piping to combine file listing, metadata extraction, and statistical reporting; export results to a dated report file.
- Implement a comprehensive error-handling pipeline: read output, catch errors, log them separately, and generate a summary of successes vs failures.
- Design and execute a real-world project backup workflow: use piping to verify file existence, count files by type, generate a backup manifest, and create audit logs — all in one integrated command pipeline.
References
- GNU. (2024). Redirections in Bash. https://example.com
- GNU. (2024). grep command reference. https://example.com
- GNU. (2024). Bash pipeline concepts. https://example.com
Helpful Resources
Lesson 4: Environment Variables, PATH, and Aliases
Estimated time: 30-45 minutes
Learning Objectives
- Read environment variables with
$VARNAME - Inspect and verify programs in the
PATH - Create temporary aliases and understand making them persistent via
.bashrc
Materials
- Git Bash (with rights to edit
.bashrc)
Step-by-step Tasks
- Show your username and home path with
echo $USERandecho $HOME. - Inspect
echo $PATHand identify whetheropenscadorcodewould be found. - Run
which openscadand note the result. - Create a temporary alias:
alias preview='openscad'and testpreview myfile.scad. - Open your profile (
notepad.exe ~/.bashrc) and add the alias line to make it persistent.
Checkpoints
- After step 3 you can determine whether a program will be found by
PATH.
Quiz - Lesson GitBash.4
3DMake in Practice: Aliases in .bashrc
Bash aliases make your 3DMake workflow much faster:
# Quick alias to jump to your 3D projects folder
alias 3dp='cd ~/Documents/3d_projects'
# Full build-slice-print pipeline in one word
alias 3dprint='3dm build slice print'
# Build and then get an AI description of the model
alias 3dinfo='3dm build && 3dm info'
# Make sure 3dm is in your PATH (add to .bashrc if needed)
echo 'export PATH="$PATH:$HOME/Downloads/3dmake"' >> ~/.bashrc
# Persist all three aliases in .bashrc
echo "alias 3dp='cd ~/Documents/3d_projects'" >> ~/.bashrc
echo "alias 3dprint='3dm build slice print'" >> ~/.bashrc
echo "alias 3dinfo='3dm build && 3dm info'" >> ~/.bashrc
# Reload .bashrc immediately without restarting
source ~/.bashrc
# Now use them:
3dp # jump to your 3D projects folder
3dprint # run the full pipeline
3dinfo # build and describe the model
Checkpoints
- After step 3 you can determine whether a program will be found by
PATH.
Quiz - Lesson GitBash.4
- How do you print an environment variable?
- What is the purpose of
PATH? - How do you check whether
openscadis available? - How do you create a temporary alias?
- Where would you make an alias permanent?
- True or False: Environment variables in bash are case-sensitive.
- Explain why having a program in your PATH is useful compared to always using its full file path.
- Write a command that would create an alias called
slicerfor the OpenSCAD executable. - What file would you edit to make an alias persist across Git Bash sessions?
- Describe a practical benefit of using the
$TMPDIRor/tmpdirectory for temporary files in a 3D printing workflow. - You have a custom script at
~/scripts/backup_models.shthat you want to run from anywhere asbackup-now. What steps would you take to make this work? - Explain the difference between setting an environment variable in the current session with
exportvs. adding it to.bashrcfor permanence. - Design a
.bashrcstrategy for managing multiple 3D printing projects, each with different tool paths and directories; show how to structure environment variables for each. - If a program is not found by
which, what are the possible reasons, and how would you troubleshoot? - Describe how you would verify that your
.bashrcis loading correctly and how to debug issues if aliases or environment variables don’t appear after restarting Git Bash.
Extension Problems
- Add a folder to PATH for a test program (describe steps; do not change system PATH without admin).
- Create a short
.bashrcsnippet that sets two aliases and test re-opening Git Bash. - Use
whichto list the path for several common programs. - Explore
$TMPDIRor/tmpand create a file there. - Save a copy of your current PATH to a text file and examine it in your editor.
- Create a
.bashrcscript that loads custom aliases and environment variables for your 3D printing workflow; test it in a new session. - Build a “project profile” that sets environment variables for CAD, slicing, and print directories; switch between profiles for different projects.
- Write a script that audits your current environment variables and creates a summary report of what’s set and why.
- Design a custom alias system for common 3D printing commands; document the aliases and their purposes.
- Create a profile migration guide: document how to export and import your
.bashrcacross machines for consistent workflows. - Implement a safe PATH modification script: create a utility that allows you to add/remove directories from PATH for the current session only; show how to make it permanent in
.bashrc. - Build a comprehensive
.bashrcframework with modular sourcing: create separate.shfiles for aliases, environment variables, and functions; have your main.bashrcsource all of them. - Develop an environment validation tool: write a bash script that checks whether all required programs (OpenSCAD, slicers, etc.) are accessible via PATH; report findings and suggest fixes.
- Create a project-switching alias system: design a function that changes all environment variables and aliases based on the current project; test switching between multiple projects.
- Build a
.bashrctroubleshooting guide: create a script that exports your current environment state (variables, aliases, PATH) to a timestamped file, allowing you to compare states before and after changes.
References
- GNU. (2024). Environment variables in Bash. https://example.com
- GNU. (2024). alias command reference. https://example.com
- GNU. (2024). Creating and using Bash profiles. https://example.com
Helpful Resources
- Environment Variables in Bash
- Understanding the PATH Variable
- Bash alias Reference
- Creating a Bash Profile (.bashrc)
- which Command for Locating Programs
Lesson 5: Filling in the Gaps — Shell Profiles, History, and Useful Tricks
Estimated time: 30-45 minutes
Learning Objectives
- Use history and abort commands (
history,Ctrl+R,Ctrl+C) - Inspect and edit your
.bashrcprofile for persistent settings - Run programs by full path using
./or absolute paths - Handle common screen reader edge cases when using the terminal
Materials
- Git Bash and an editor (Notepad/VS Code)
Step-by-step Tasks
- Run several simple commands (e.g.,
pwd,ls -1,echo hi) then runhistoryto view them. - Use
!<n>to re-run a previous command by its history number (replace<n>with a history number). - Practice aborting a long-running command with
Ctrl + C(for example,ping google.com). - Open your profile:
notepad.exe ~/.bashrc; if it doesn’t exist, create it:touch ~/.bashrc. - Add a persistent alias line to your profile (example:
alias preview='openscad'), save, and runsource ~/.bashrcor reopen Git Bash to verify.
Checkpoints
- After step 2 you can re-run a recent command by history number.
- After step 5 your alias should persist across sessions.
Quiz - Lesson GitBash.5
- How do you view the command history in Git Bash?
- Which key combination aborts a running command?
- What does
echo $BASH_VERSIONshow? - How does
./help run scripts and executables in the current directory? - What is one strategy if terminal output stops being announced by your screen reader?
- True or False: Using
Ctrl+Cpermanently deletes any files created by the command you abort. - Explain the difference between
historyandCtrl+R(reverse history search) in Git Bash. - If you add an alias to
.bashrcbut it doesn’t take effect after opening a new Git Bash window, what should you verify? - Write a command that would run a script at the path
~/scripts/openscad_runner.shdirectly. - Describe a practical workflow scenario where having keyboard shortcuts (aliases) in your
.bashrcwould save time. - Explain how to re-run the 5th command from your history using
!5, and what would happen if that command had file operations (creates/deletes). - Design a
.bashrcinitialization strategy that separates utilities for different projects; explain how you would switch between them. - Walk through a troubleshooting workflow: your screen reader stops announcing output after running a long command. What steps would you take to diagnose and resolve the issue?
- Create a safety checkpoint system: before any destructive operation (mass delete, overwrite), how would you use
.bashrcfunctions and history to verify the command is correct? - Develop a comprehensive capstone scenario: integrate everything from Bash Lesson 0 through Bash Lesson 5 (navigation, file operations, piping, environment setup, history) to design an automated 3D printing project workflow with error handling and logging.
Extension Problems
- Add an alias and an environment variable change to your
.bashrcand document the behavior after reopening Git Bash. - Create a short bash script that automates creating a project folder and an initial
.scadfile. - Experiment with running OpenSCAD by full path using
./and by placing it in PATH; compare results. - Practice redirecting
man lsoutput to a file and reading it in Notepad for screen reader clarity. - Document three screen reader troubleshooting steps you used and when they helped.
- Build a comprehensive
.bashrcthat includes aliases, environment variables, and helper functions for your 3D printing workflow. - Create a bash script that troubleshoots common Git Bash issues (module loading, permission errors, command not found); test at least three scenarios.
- Write a bash function that coordinates multiple tasks: creates a project folder, starts OpenSCAD, and opens a notes file.
- Design a screen-reader accessibility guide for Git Bash: document commands, outputs, and accessible navigation patterns.
- Develop an advanced Git Bash workflow: implement error handling, logging, and confirmation prompts for risky operations.
- Implement an “undo” system using history: create a function that logs destructive commands (
rm,mv,cp) and allows you to review the last operation. - Build a
.bashrcdebugger: create a script that compares two Git Bash sessions’ environment states (variables, aliases, functions) to identify what loaded/failed to load. - Develop a multi-project profile manager: design a system where you can switch entire environments (paths, aliases, variables) for different 3D printing projects by running a single command.
- Create a comprehensive accessibility analyzer: write a bash script that tests whether key Git Bash commands produce screen-reader-friendly output; document workarounds for commands that don’t.
- Design a complete capstone project: build an integrated automation suite that manages a 3D printing workflow (project setup, file organization, CAD/slicing tool automation, output logging, error recovery, and audit trails) with full error handling and documentation.
References
- GNU. (2024). Bash history and recall functionality. https://example.com
- GNU. (2024). Understanding and creating Bash profiles. https://example.com
- GNU. (2024). Running scripts and executables in Bash. https://example.com
Helpful Resources
- Bash History and Recall
- Understanding .bashrc
- history Command Reference
- Running Scripts with ./
- Screen Reader Tips and Tricks
Lesson 6: Advanced Techniques — Shell Scripts, Functions, and Professional Workflows
Duration: 4-4.5 hours (for screen reader users) Prerequisites: Complete Bash Lesson 0 through Bash Lesson 5 Skill Level: Advanced intermediate
3DMake in Practice: Automating Your Print Workflow
Use a shell script to fully automate a 3DMake workflow across multiple projects:
#!/bin/bash
# batch_print.sh - build and print every 3DMake project in a folder
PROJECTS_DIR="$HOME/Documents/3d_projects"
for project in "$PROJECTS_DIR"/*/; do
name=$(basename "$project")
echo "Processing: $name"
cd "$project"
if 3dm build slice > build_log.txt 2>&1; then
echo " OK - sending to printer"
3dm print
else
echo " FAILED - check build_log.txt"
cat build_log.txt
fi
done
echo "Batch complete."
Tip
Save as
batch_print.sh, runchmod +x batch_print.shonce to make it executable, then run with./batch_print.sh. If you forgetchmod +xyou’ll get “Permission denied” — just run thechmodcommand and try again.
Save as batch_print.sh, make executable with chmod +x batch_print.sh, then run with ./batch_print.sh. This script uses loops, conditionals, and redirection — all from this lesson.
This lesson extends Git Bash skills to professional-level workflows. You’ll learn to automate complex tasks, write reusable shell scripts, and integrate tools for 3D printing workflows.
Learning Objectives
By the end of this lesson, you will be able to:
- Create and run shell scripts (.sh files)
- Write functions that accept parameters
- Use loops to repeat tasks automatically
- Automate batch processing of 3D models
- Debug scripts when something goes wrong
- Create professional workflows combining multiple tools
Shell Script Basics
What’s a Shell Script?
A shell script (.sh) contains multiple bash commands that run in sequence. Instead of typing commands one by one, you put them in a file and run them all at once.
Why use shell scripts?
- Repeatability: Run the same task 100 times identically
- Documentation: Commands are written down for reference
- Complexity: Combine many commands logically
- Automation: Schedule scripts to run automatically
Creating Your First Shell Script
Step 1: Open a text editor
notepad.exe my-first-script.sh
Step 2: Type this script
#!/bin/bash
# This is a comment - screen readers will read it
echo "Script is running!"
pwd
ls -1
echo "Script is done!"
Step 3: Save the file
- In Notepad: Ctrl+S
- Make sure filename ends in
.sh - Save in an easy-to-find location (like Documents)
Note
Before you can run a
.shscript, you must make it executable withchmod +x scriptname.sh. This is a one-time step per script. Without it, running./script.shwill produce a “Permission denied” error even though the file exists.
Step 4: Make it executable and run the script
chmod +x my-first-script.sh
./my-first-script.sh
What happens: Bash runs each command in sequence and shows output.
Important
Always start shell scripts with
#!/bin/bash(the “shebang” line). Without it, the system may use a different shell to run your script, which can cause unexpected errors — especially on systems where/bin/shis not bash.
Important: The Shebang Line
The #!/bin/bash at the top of your script (called a “shebang”) tells the system which shell to use to run the script.
#!/bin/bash
# Now bash runs every command below
echo "Hello!"
Variables and Parameters
Using Variables
Variables store values you want to use later.
Example script:
#!/bin/bash
mypath="$HOME/Documents"
cd "$mypath"
echo "I am now in:"
pwd
ls -1
Breaking it down:
mypath="..."assigns the variable (no spaces around=)
Tip
Always quote variables that contain file paths: use
"$mypath"not$mypath. Without quotes, spaces in folder names will break your script. This is one of the most common bash scripting mistakes.
"$mypath"uses the variable (quote it to handle spaces in paths)- Variables in bash are always referenced with
$
Functions with Parameters
A function is reusable code that you can run with different inputs.
Example: A function that lists files in a folder
#!/bin/bash
list_folder() {
local path="$1"
echo "Contents of: $path"
cd "$path"
ls -1
}
# Use the function:
list_folder "$HOME/Documents"
list_folder "$HOME/Downloads"
What’s happening:
list_folder()defines the functionlocal path="$1"assigns the first argument to a local variable$1is the first argument passed to the function- Call the function with
list_folder "path/to/folder"
Screen reader tip: When you call a function, bash will announce the results just like any command.
Loops - Repeating Tasks
Loop Over Files
Imagine you have 10 SCAD files and want to print their contents. You could do it 10 times manually, or use a loop.
Example: Print every .scad file in a folder
#!/bin/bash
for file in *.scad; do
echo "=== File: $file ==="
cat "$file"
echo ""
done
What’s happening:
for file in *.scad; doiterates over each.scadfile$fileholds the current filenamedoneends the loop- Inside the loop, do something with each
$file
Loop with a Counter
Example: Do something 5 times
#!/bin/bash
for i in $(seq 1 5); do
echo "This is iteration number $i"
# Do something here
done
What’s happening:
for i in $(seq 1 5)loops withifrom 1 to 5$iis the counter variable
Real-World Example - Batch Processing SCAD Files
Scenario
You have 10 OpenSCAD (.scad) files in a folder. You want to:
- List them all
- Check how many there are
- For each one, verify it exists
The Script
#!/bin/bash
scad_folder="$HOME/Documents/3D_Projects"
count=0
echo "Processing SCAD files in: $scad_folder"
echo ""
for file in "$scad_folder"/*.scad; do
if [ -f "$file" ]; then
echo " Found: $(basename "$file")"
count=$((count + 1))
else
echo " Missing: $(basename "$file")"
fi
done
echo ""
echo "Total files found: $count"
echo "Batch processing complete!"
Breaking it down:
scad_folder="..."= where to lookfor file in "$scad_folder"/*.scad= find all .scad filesif [ -f "$file" ]= check if file exists and is a regular filebasename "$file"= just the filename (not the full path)count=$((count + 1))= increment the counter
Running the Script
- Save as
batch-process.sh - Edit
scad_folderto match your real folder - Make it executable and run it:
chmod +x batch-process.sh ./batch-process.sh
Screen reader output:
Processing SCAD files in: /c/Users/YourName/Documents/3D_Projects
Found: model1.scad
Found: model2.scad
Found: model3.scad
[... more files ...]
Total files found: 10
Batch processing complete!
Error Handling
Try-Style Checks with Exit Codes
What if something goes wrong? Use exit code checks:
Example:
#!/bin/bash
file="$HOME/nonexistent/path/file.txt"
if cat "$file" 2>/dev/null; then
echo "File read successfully"
else
echo "Error: Could not read file"
echo "File path was: $file"
fi
What’s happening:
2>/dev/nullsuppresses error messages fromcatif cat ...; thenchecks whether the command succeededelsehandles the failure gracefully
Screen reader advantage: Errors are announced clearly instead of crashing silently.
Validating Input
Example: Make sure a folder exists before processing
#!/bin/bash
process_folder() {
local folder_path="$1"
if [ ! -d "$folder_path" ]; then
echo "Error: Folder does not exist: $folder_path"
return 1
fi
echo "Processing folder: $folder_path"
ls -1 "$folder_path"
}
process_folder "$HOME/Documents"
What’s happening:
[ ! -d "$folder_path" ]checks if the path is NOT a directoryreturn 1exits the function early with a non-zero (error) status
Debugging Shell Scripts
Common Errors and Solutions
Error 1: “Command not found”
Cause: Typo in command name
Fix: Check spelling
# Wrong:
ech "hello"
# Correct:
echo "hello"
Error 2: “Variable is empty”
Cause: Variable was never assigned or has a typo
Fix: Make sure variable is set before using it
myvar="hello" # Set first
echo "$myvar" # Then use
Error 3: “No such file or directory”
Cause: Wrong folder path
Fix: Verify path exists
# Check if path exists:
if [ -d "$HOME/Documents" ]; then
echo "Path exists"
fi
Error 4: “Permission denied”
Cause: Script not executable, or no write permission
Fix: Make the script executable, or check file permissions
chmod +x my-script.sh
Debugging Technique: Trace Output with set -x
Add set -x at the top of your script to print each command before it runs:
#!/bin/bash
set -x # Enable trace mode
path_var="$HOME/Documents"
echo "Starting script. Path is: $path_var"
for file in "$path_var"/*; do
echo "Processing: $file"
# Do something with $file
echo "Done with: $file"
done
echo "Script complete"
Your screen reader will announce each step, so you know where errors happen.
Creating Professional Workflows
Example 1: Automated Project Setup
Scenario: You start a new 3D printing project regularly. Instead of creating folders manually:
#!/bin/bash
read -p "Enter project name: " project_name
base_folder="$HOME/Documents/3D_Projects"
project_folder="$base_folder/$project_name"
# Create folder structure
mkdir -p "$project_folder"
mkdir -p "$project_folder/designs"
mkdir -p "$project_folder/output"
mkdir -p "$project_folder/notes"
# Create a README
cat > "$project_folder/README.txt" << EOF
# $project_name
Created: $(date)
## Designs
All .scad files go here.
## Output
STL and other exports go here.
## Notes
Project notes and observations.
EOF
echo "Project setup complete: $project_folder"
What it does:
- Prompts for a project name
- Creates folder structure for a new project
- Sets up subfolders for designs, output, notes
- Creates a README file automatically
Example 2: Batch File Verification
Scenario: Before processing, verify all required files exist:
#!/bin/bash
verify_project() {
local project_folder="$1"
local required_items=("README.txt" "designs" "output" "notes")
local all_good=true
for item in "${required_items[@]}"; do
local path="$project_folder/$item"
if [ -e "$path" ]; then
echo " Found: $item"
else
echo " Missing: $item"
all_good=false
fi
done
if $all_good; then
echo "All checks passed!"
return 0
else
echo "Some files are missing!"
return 1
fi
}
# Use it:
project="$HOME/Documents/3D_Projects/MyKeychain"
if verify_project "$project"; then
echo "Safe to proceed with processing"
fi
Screen Reader Tips for Shell Scripts
Making Script Output Readable
Problem: Script runs but output scrolls too fast or is hard to follow
Solution 1: Save to file
./my-script.sh > output.txt
notepad.exe output.txt
Solution 2: Use echo with clear sections
echo "========== STARTING =========="
echo ""
# ... script ...
echo ""
echo "========== COMPLETE =========="
Solution 3: Pause between major sections
echo "Pausing... Press Enter to continue"
read
Your screen reader will announce the pause, give you time to read output.
Announcing Progress
For long-running scripts:
#!/bin/bash
count=0
total=$(ls *.scad | wc -l)
for file in *.scad; do
count=$((count + 1))
echo "Processing $count of $total: $file"
# Do something with $file
done
echo "All $count files processed!"
Practice Exercises
Exercise 1: Your First Shell Script
Goal: Create and run a simple shell script
Steps:
- Create file:
notepad.exe hello.sh - Type:
#!/bin/bash echo "Hello from my first Git Bash shell script!" pwd ls -1 - Save, make executable, and run:
chmod +x hello.sh ./hello.sh
Checkpoint: You should see output for each command.
Exercise 2: Script with a Variable
Goal: Use a variable to make the script flexible
Steps:
- Create file:
notepad.exe smart-listing.sh - Type:
#!/bin/bash target_folder="$HOME/Documents" echo "Listing contents of: $target_folder" ls -1 "$target_folder" - Edit
target_folderto a real folder on your computer - Run:
chmod +x smart-listing.sh ./smart-listing.sh
Checkpoint: You should see listing of that specific folder.
Exercise 3: Function
Goal: Create a reusable function
Steps:
- Create file:
notepad.exe navigate.sh - Type:
#!/bin/bash go_to() { local path="$1" if [ -d "$path" ]; then cd "$path" echo "Now in: $(pwd)" echo "Contents:" ls -1 else echo "Path does not exist: $path" fi } # Test the function: go_to "$HOME/Documents" go_to "$HOME/Downloads" - Run:
chmod +x navigate.sh ./navigate.sh
Checkpoint: Both function calls should work, showing contents of each folder.
Exercise 4: Loop
Goal: Use a loop to repeat an action
Steps:
- Create file:
notepad.exe repeat.sh - Type:
#!/bin/bash echo "Demonstrating a loop:" for i in $(seq 1 5); do echo "Iteration $i: Hello!" done echo "Loop complete!" - Run:
chmod +x repeat.sh ./repeat.sh
Checkpoint: Should print “Iteration 1” through “Iteration 5”.
Exercise 5: Real-World Script
Goal: Create a useful script for a real task
Steps:
- Create a folder:
mkdir ~/Documents/TestFiles - Create some test files:
echo "test" > ~/Documents/TestFiles/file1.txt echo "test" > ~/Documents/TestFiles/file2.txt echo "test" > ~/Documents/TestFiles/file3.txt - Create script:
notepad.exe report.sh - Type:
#!/bin/bash folder="$HOME/Documents/TestFiles" count=0 echo "=== FILE REPORT ===" echo "Folder: $folder" echo "" echo "Files:" for file in "$folder"/*; do echo " - $(basename "$file")" count=$((count + 1)) done echo "" echo "Total: $count files" echo "=== END REPORT ===" - Run:
chmod +x report.sh ./report.sh
Checkpoint: Should show report of all files in the test folder.
Quiz - Lesson GitBash.6
- What is a shell script?
- What file extension do bash shell scripts use?
- What is a variable in bash and how do you create one?
- What is a function and why would you use one?
- How do you run a shell script?
- What is a
forloop and what doesfor file in *.scad; dodo? - What does
[ -f "$file" ]check? - How do you handle errors in a bash script?
- When would you use
if [ ! -d "$path" ]; then? - What technique makes shell script output readable for screen readers?
Extension Problems
- Auto-Backup Script: Create a bash script that copies all files from one folder to another, announcing progress
- File Counter: Write a function that counts files by extension (.txt, .scad, .stl, etc.)
- Folder Cleaner: Script that deletes files older than 30 days (with user confirmation)
- Project Template: Function that creates a complete project folder structure with all needed files
- Batch Rename: Script that renames all files in a folder according to a pattern
- Log Generator: Create a script that records what it does to a log file for later review
- Scheduled Task: Set up a script to run automatically using cron or Task Scheduler
- File Verifier: Check that all SCAD files in a folder have corresponding STL exports
- Report Generator: Create a summary report of all projects in a folder
- Error Tracker: Script that lists all commands that had errors and logs them with timestamps
Important Notes
- Always test scripts on small sets of files first before running them on important data
- Save your work regularly — use version naming if possible
- Test error handling — make sure errors don’t crash silently
- Document your scripts — use
#comments so you remember what each part does - Backup before batch operations — if something goes wrong, you have the original
References
- GNU Bash Scripting Guide: https://example.com
- Function Documentation: https://example.com
- Error Handling: https://example.com
- Loops: https://example.com
Unit Exam — Comprehensive Assessment
Estimated time: 60-90 minutes
Key Learning Outcomes Assessed
By completing this unit test, you will demonstrate:
- Understanding of file system navigation and path concepts
- Proficiency with file and folder manipulation commands
- Ability to redirect and pipe command output
- Knowledge of environment variables and aliases
- Screen-reader accessibility best practices in terminal environments
- Problem-solving and command chaining skills
Target Audience
Users who have completed Bash Lesson 0 through Bash Lesson 6 and need to demonstrate mastery of Git Bash fundamentals.
Instructions
Complete all sections below. For multiple choice, select the best answer. For short answers, write one to two sentences. For hands-on tasks, capture evidence (screenshots or output files) and submit alongside your answers.
Part A: Multiple Choice Questions (20 questions)
Select the best answer for each question. Each question is worth 1 point.
-
What is the primary purpose of the
PATHenvironment variable?- A) Store your home directory location
- B) Tell the shell where to find executable programs
- C) Configure the visual appearance of the terminal
- D) Store the current working directory name
-
Which command prints your current working directory in Git Bash?
- A)
ls -1 - B)
cd - C)
pwd - D)
whoami
- A)
-
What does the
~symbol represent in Git Bash paths?- A) The root directory
- B) The current directory
- C) The parent directory
- D) The home directory
-
How do you list only file names (not full details) in a way that is screen-reader friendly?
- A)
ls - B)
ls -1 - C)
ls -l - D)
cat -1
- A)
-
Which command creates a new empty file in Git Bash?
- A)
mkdir filename - B)
touch filename - C)
new filename - D)
echo filename
- A)
-
What is the difference between
>and>>?- A)
>redirects to file,>>displays on screen - B)
>overwrites a file,>>appends to a file - C) They do the same thing
- D)
>is for text,>>is for binary
- A)
-
What does the pipe operator
|do?- A) Creates a folder
- B) Sends the output of one command to the input of another
- C) Deletes files matching a pattern
- D) Lists all processes
-
Which command copies a file in Git Bash?
- A)
mv - B)
rm - C)
cp - D)
cd
- A)
-
How do you rename a file from
oldname.txttonewname.txtin Git Bash?- A)
cp oldname.txt newname.txt - B)
mv oldname.txt newname.txt - C)
rename oldname.txt newname.txt - D)
rn oldname.txt newname.txt
- A)
-
What is the purpose of
grepin Git Bash piping?- A) Find files in a directory
- B) Search for text patterns within output or files
- C) Select a string to copy to clipboard
- D) Select which shell to use
-
Which key allows you to autocomplete a path in Git Bash?
- A)
Ctrl + A - B)
Ctrl + E - C)
Tab - D)
Space
- A)
-
How do you copy text to the Windows clipboard from Git Bash?
- A)
cat filename > clipboard - B)
cat filename | clip - C)
copy filename - D)
cat filename | paste
- A)
Tip
Use
which programnameto check whether a program is in your PATH and find its full path. Ifwhich openscadreturns nothing, OpenSCAD is not in your PATH and you’ll need to add it or call it by its full path.
-
What does
which openscaddo?- A) Opens the OpenSCAD application
- B) Gets help about the openscad command
- C) Locates the full path of the openscad executable
- D) Lists all available commands
-
Which wildcard matches any single character in Git Bash?
- A)
* - B)
? - C)
% - D)
#
- A)
-
What is the purpose of
./before a script name?- A) Run a script in the current directory
- B) Execute all commands in parallel
- C) Combine multiple commands
- D) Create an alias
-
How do you create a temporary alias in Git Bash?
- A)
set-alias preview='openscad' - B)
alias preview='openscad' - C)
new-alias preview openscad - D)
preview = openscad
- A)
Important
Aliases saved only in the terminal session are lost when you close Git Bash. To make an alias permanent, add it to
~/.bashrc. After editing.bashrc, runsource ~/.bashrcto apply changes without restarting.
- Where is a Git Bash alias typically stored to persist across sessions?
- A)
C:\Program Files\Git\profile.sh - B) In the
~/.bashrcfile - C)
~/bash_profile - D) Aliases cannot be made permanent
- A)
Important
Ctrl+C is the universal “abort” key — it stops any running command immediately and returns you to the prompt. This works in Git Bash, CMD, and PowerShell. Use it whenever a command hangs, loops unexpectedly, or produces unwanted output.
-
How do you abort a long-running command in Git Bash?
- A) Press
Escape - B) Press
Ctrl + X - C) Press
Ctrl + C - D) Press
Alt + F4
- A) Press
-
What command shows the history of previously run commands in Git Bash?
- A)
history - B)
get-history - C)
show-history - D)
bash-history
- A)
Tip
After editing
~/.bashrc, runsource ~/.bashrcto apply your changes immediately without restarting Git Bash. Without this step, new aliases and variables won’t take effect until the next time you open a terminal.
- How do you reload your
.bashrcwithout restarting Git Bash?- A) Use
reload ~/.bashrcin the terminal - B) Use
source ~/.bashrc - C) Use the Windows Control Panel
- D)
.bashrcreloads automatically
- A) Use
Part B: Short Answer Questions (10 questions)
Answer each question in one to two sentences. Each question is worth 2 points.
-
Explain the difference between absolute and relative paths. Give one example of each.
-
Why is
ls -1preferred overlsfor screen reader users? Describe what flag combination you would use to list only directories. -
What is the purpose of redirecting output to a file, and give an example of when you would use
>instead of>>? -
Describe what would happen if you ran
rm -r ~/Documents/my_folderand why this command should be used carefully. -
How would you search for all files with a
.scadextension in your current directory? Write the command. -
Explain what happens when you pipe the output of
ls -1intoclip. What would you do next? -
What is an environment variable, and give one example of how you might use it in Git Bash.
-
If a program is not in your
PATH, what two methods could you use to run it from Git Bash? -
Describe how you would open a file in Notepad and also add a line to it from Git Bash.
-
What is one strategy you would use if your screen reader stops announcing terminal output while using Git Bash?
Part C: Hands-On Tasks (10 tasks)
Complete each task and capture evidence (screenshots, output files, or command transcripts). Each task is worth 3 points.
Tasks 1-5: File System and Navigation
-
Create a folder structure
~/Documents/GitBash_Assessment/Projectsusing a single command. Capture thels -1output showing the creation. -
Create five files named
project_1.scad,project_2.scad,project_3.txt,notes_1.txt, andnotes_2.txtinside theProjectsfolder. Use wildcards to list only.scadfiles, then capture the output. -
Copy the entire
Projectsfolder toProjects_Backupusingcp -r. Capture thels -1output showing both folders exist. -
Move (rename)
project_1.scadtoproject_1_final.scad. Capture thels -1output showing the renamed file. -
Delete
notes_1.txtandnotes_2.txtusing a singlermcommand with wildcards. Capture the finalls -1output.
Tasks 6-10: Advanced Operations and Scripting
-
Create a file called
my_data.txtwith at least four lines usingechoand>>. Then read it withcat my_data.txtand capture the output. -
Use
grepto search for a keyword (e.g., “project”) inmy_data.txtand pipe the results toclip. Paste the results into Notepad and capture a screenshot. -
List all files in the
Projectsfolder and redirect the output toprojects_list.txt. Open it in Notepad and capture a screenshot of the file. -
Create a temporary alias called
mylsthat runsls -1, test it, and capture the output. Then explain what would be required to make it persistent. -
Run
man ls(orls --help) and redirect the output tohelp_output.txt. Open the file in Notepad and capture a screenshot showing at least the first page of help content.
Grading Rubric
| Section | Questions | Points Each | Total |
|---|---|---|---|
| Multiple Choice | 20 | 1 | 20 |
| Short Answer | 10 | 2 | 20 |
| Hands-On Tasks | 10 | 3 | 30 |
| Total | 40 | - | 70 |
Passing Score: 49 points (70%)
Helpful Resources for Review
- Git Bash Command Reference
- Navigation and File System
- Using Pipes and Filtering
- Bash Profile and Aliases
- Screen Reader Accessibility Tips
Submission Checklist
- All 20 multiple choice questions answered
- All 10 short answer questions answered (1-2 sentences each)
- All 10 hands-on tasks completed with evidence captured
- Files/screenshots organized and labeled clearly
- Submission includes this checklist