Course → Module 4: The Workspace
Session 3 of 7

Ten Commands, Not a Computer Science Degree

The terminal is a text-based interface. You type a command. The computer executes it. You see the result. No icons, no menus, no drag-and-drop. This looks intimidating if you have never used one. It is not. You need approximately ten commands for AI content production. Everything beyond those ten, your AI coding assistant can handle.

The terminal inside VS Code is identical to a standalone terminal application. The difference is convenience: you do not leave your editor to run scripts. Press Ctrl+` (backtick) to open it. Press it again to close it.

The terminal is not programming. It is operating. The same way you operate a car without understanding the combustion engine, you operate a terminal without understanding operating system internals. You learn the controls, not the engineering.

The Essential Ten

These ten commands cover navigation, file operations, and script execution. Memorize the first five. Reference the rest until they become muscle memory.

Command What It Does Example
cd Change directory (navigate to a folder) cd prompts
ls List files and folders in current location ls
mkdir Create a new folder mkdir reviewed
python Run a Python script python generate.py
pip install Install a Python package pip install anthropic
cat Display file contents cat output.md
cp Copy a file cp draft.md reviewed/draft.md
mv Move or rename a file mv old-name.md new-name.md
rm Delete a file rm failed-output.md
clear Clear the terminal screen clear

On Windows, some of these commands differ slightly. If you are using PowerShell (the default terminal in VS Code on Windows), ls and cat work but behave differently. The safest approach: configure VS Code to use Git Bash as its default terminal. Your AI assistant can help with this in thirty seconds.

Navigation: Where Am I?

The terminal always has a current location, called the working directory. Every command executes relative to this location. When you type python generate.py, the terminal looks for generate.py in the current directory. If you are in the wrong directory, the command fails.

graph TD A["Home Directory ~/"] --> B["ai-production-course/"] B --> C["prompts/"] B --> D["outputs/"] B --> E["scripts/"] E --> F["generate.py"] E --> G["batch.py"] H["Terminal Command"] --> I["cd ai-production-course"] I --> J["cd scripts"] J --> K["python generate.py"] style A fill:#222221,stroke:#8a8478,color:#ede9e3 style B fill:#222221,stroke:#c8a882,color:#ede9e3 style E fill:#222221,stroke:#6b8f71,color:#ede9e3 style F fill:#191918,stroke:#c47a5a,color:#ede9e3 style H fill:#222221,stroke:#c8a882,color:#ede9e3 style K fill:#222221,stroke:#6b8f71,color:#ede9e3

Two navigation shortcuts save time. cd .. moves up one level (from scripts/ back to ai-production-course/). cd ~ jumps to your home directory from anywhere. And pwd (print working directory) tells you exactly where you are if you get lost.

Running Scripts

The primary reason you use the terminal is to run Python scripts. The pattern is always the same:

  1. Navigate to the folder containing the script: cd scripts
  2. Run the script: python generate.py
  3. Read the output in the terminal or check the output file

When a script fails, the terminal displays an error message. These messages look cryptic at first. They are actually precise. The last line usually tells you exactly what went wrong: ModuleNotFoundError: No module named 'anthropic' means you need to run pip install anthropic. Copy the error message and paste it into your AI coding assistant. The AI will explain the error and tell you how to fix it.

Chaining Commands

You can run multiple commands in sequence using &&. The second command only runs if the first succeeds. This is useful for running a script and immediately checking its output.

python generate.py && cat outputs/latest.md

This runs the generation script and, if it succeeds, displays the output file. One line instead of two. Small convenience. Over hundreds of runs, significant time savings.

Further Reading

Assignment

Open the terminal in VS Code. Navigate to your course project folder. List its contents with ls. Create a new file by asking your AI assistant for the command. Delete it using the terminal. Run a Python script (even a one-line script that prints "hello"). Document each command you used and what it did. This is your terminal cheat sheet. Keep it in your notes.md file.