By the end of this lesson, cadets will be able to:
Complete before class. These are short and set the vocabulary we will use.
| Source | Sections | Why |
|---|---|---|
| Ubuntu CLI | Command Line for Beginners — Steps 1 to 3 (skip the later scripting sections) | What the terminal is and how to use it |
| Beej-C | Chapters 1 to 2 (Foreword, Hello World) | Orientation and your first C program |
| Beej-Git | Chapters 1 to 3 (Foreword, Git Basics, GitHub: How To Use It) | Clone, commit, push fundamentals |
Run each verification command in your VM's terminal. The expected output gives you something concrete to compare against. If your output looks substantially different, that step failed and the rest will not work until you go back and fix it.
.exe installer download starts.Download Hosts VM → SharePoint, opens in a new tab
C:\CS210\VMs\). You may see a Routers VM listed alongside the Hosts VM on SharePoint; you will not need it for CS210..vmx file. The VM should appear in your library. Click the green Play button to boot it. If VMware asks whether you moved or copied the VM, choose I Copied It.build-essential — gcc (the C compiler) and make (the build automation tool you will meet in Lesson 7)gdb — the GNU Debugger, used to step through your code and inspect program state when something goes wrongvalgrind — memory error detector you will use heavily in Block 2git — the version control system you will use every lesson.deb package from code.visualstudio.com using Firefox inside the VM, then install it from your terminal:code in the terminal. Click the Extensions icon in the left sidebar (or press Ctrl+Shift+X), and install:cd, paths, and basic file operations already in your hands so we can move faster in class.pwd, ls, cd). About 10 minutes.mv, cp, and rm. About 15 minutes.The setup you did has a story behind it. This section contains the concepts and reference material for the lesson: the slides we will use, the compilation pipeline that explains what gcc actually does, your first C program, and the Git workflow you will use every day. The hands-on practice with these commands lives in Section 5.
The Lesson 1 deck covers course orientation, the toolchain, the compilation pipeline, and a live demo of writing and compiling hello.c. The slides are the spine of the in-class hour; the reference material below is the persistent companion you can return to any time.
Open Lesson 1 slides → opens in a new tab
A reference for the commands you will use every day at the terminal. The Ubuntu reading covers what a terminal is; the table below is the quick lookup for what each command does. The practice terminals in Section 5 drill these.
| Command | Example | What it does |
|---|---|---|
| pwd | pwd | Print working directory (where am I right now) |
| ls | ls -la | List files in the current directory (-l long format, -a include hidden) |
| cd | cd cli_lab cd .. | Change directory (.. goes up one level, ~ jumps home) |
| mkdir | mkdir cli_lab | Make a new directory |
| touch | touch notes.txt | Create an empty file |
| cat | cat hello.c | Print the entire contents of a file to the terminal |
| head / tail | head -n 5 file | Print the first or last N lines (default 10) |
| echo | echo "Hello" | Print text to the terminal |
| > (redirect) | echo "hi" > f.txt | Send command output to a file instead of the terminal (overwrites) |
| cp | cp src.txt dst.txt | Copy a file |
| mv | mv old.txt new.txt | Move or rename a file |
| rm | rm notes.txt | Remove a file (use -r for directories — permanent, no recycle bin) |
| man | man ls | Manual page for any command (press q to quit) |
| clear | clear | Clear the terminal screen |
Tab completion saves enormous time at the terminal: start typing a filename or command and press Tab. The shell completes it for you when there is only one match.
In Python, you ran python hello.py and the interpreter executed your code line by line. C does not work that way. Your .c source file must be translated into a machine-executable file before it can run.
When you type gcc hello.c -o hello, four phases happen in sequence:
#include and #define directives, producing pure C with no preprocessor lines left..o).We will dig into this pipeline in Lesson 7 when we introduce Make. For now, gcc handles all four phases for you with a single command.
Create a file called hello.c with the following contents:
Compile and run:
A few things to notice that we will return to repeatedly. Every C program starts at main. Statements end in semicolons. The return 0; at the end signals success to the operating system. The \n inside the string is a newline character; unlike Python's print(), printf does not add one for you.
Git is the version control system the entire software industry uses. Every assignment in CS210 lives in a Git repository, and you will go through this same five-command loop dozens of times this semester. Memorize it now.
| Command | What it does |
|---|---|
| git clone <url> | Download a repository to your machine. Once per assignment. |
| git status | Show what has changed since your last commit. Run this often. |
| git add <file> | Mark a changed file to be included in the next commit. |
| git commit -m "msg" | Save a snapshot of your staged changes with a short message. |
| git push | Send your local commits up to GitHub. |
Commit early, commit often. A commit every 15 to 30 minutes of work is a good rhythm. Cheap, frequent commits make it trivial to roll back when something breaks.
hello.c snippet above is the only code we touch in class today; longer examples will live in a course GitHub repo. When that repo is set up, replace this callout with a link such as <a href="https://github.com/...">Lesson 1 examples</a>.
CS210 follows the DFCS C Programming Standard for all code you write in this course. The standard is short and practical; you will meet a few sections at a time as new C concepts come up. Lesson 1 introduces three pieces:
hello.c in your lab repo already shows the format.gcc -Wall -Werror from Lesson 1 onward. -Wall turns on the warnings that catch most bugs; -Werror turns those warnings into errors so you cannot ignore them. The autograder uses the same flags.The full standard is in the course Resources section. You do not need to read it cover to cover; treat it as a reference you check when a question comes up.
Five things to do in the remaining class time. Use this checklist to track your progress. Anything not done in class should be completed as homework before Lesson 2.
Sixteen tasks across four sections: locating yourself in the filesystem, paths two ways, navigating up and sideways, and building your CS210 working folder.
Enter your name. It will appear on the completion screen so you can include it in your screenshot for the Blackboard reflection quiz.
help any time to see the commands available.
Nine tasks walking through the full daily Git cycle: clone, navigate, inspect, edit, stage, commit, push.
Enter your name. It will appear on the completion screen so you can include it in your screenshot for the Blackboard reflection quiz.
ls and cd work for exploration. The task card above tells you what command to run next. Get it right and you move to the next task. Type help any time to see available commands.
scanf from L3).