Terminal, files and Markdown · Beginner track
Written 23 November 2026. Commands checked in PowerShell 7 and Windows PowerShell 5.1, Command Prompt and Git Bash on Windows 11; details for macOS and Linux come from their documentation (see Sources).
1Where this sits
The same subject in the other tracks: the intermediate version and the advanced version. You never need them to follow this module.
| Section here | Goes further in |
|---|---|
| Folders, paths and the prompt | Absolute and relative paths (intermediate), Command Prompt, PowerShell and Git Bash (intermediate) |
| Creating folders and files | Silent success and exit codes (intermediate) |
| A first Mermaid diagram | Mermaid flowcharts and class diagrams (intermediate), Mermaid beyond flowcharts (advanced) |
2What you will be able to do
- Open a terminal and tell which folder you are in.
- Move between folders with
cdandcd .., and list what a folder holds withlsordir. - Create folders and files from the terminal and from the file explorer.
- Write a Markdown page with headings, lists, links and a code block.
- Draw a simple flowchart with Mermaid inside a Markdown file.
3What you need first
This is the first module with commands. From Orientation and how to learn you only need to know that a programmer's tools include an editor or IDE, Git and the terminal. Nothing else.
You need a computer with Windows, macOS or Linux. The examples show Windows first, because most of the course uses it, and say where macOS and Linux differ.
4The mental model
Hold two pictures in your head.
- Your files form a tree. A folder holds files and other folders, which hold more files and folders. At the top is the start of a drive, such as
C:\on Windows, or/on macOS and Linux. - A terminal always stands in one folder. That folder is called the current folder (or working directory). Every command you type acts there, unless you tell it another place.
flowchart TD
root["C:\"] --> users["Users"]
users --> you["you<br/>(your home folder)"]
you --> docs["Documents"]
you --> code["code"]
code --> lib["tool-library<br/>(you are here)"]
lib --> readme["README.md"]Read it from the top: the drive C:\ holds a folder Users, which holds your home folder you, and so on down to the file README.md. If the terminal stands in tool-library and you type a command that creates a file, the file lands in tool-library.
Folders, paths and the prompt: where you are
A terminal is a window where you type commands instead of clicking. The program inside it that reads your commands is called a shell. Which one you get depends on the system:
| System | Usual terminal | Usual shell |
|---|---|---|
| Windows 11 | Windows Terminal (search for "Terminal" in the Start menu) | PowerShell |
| macOS | Terminal (in Applications, Utilities) | zsh |
| Linux | Your desktop's terminal app | Usually Bash |
Windows also has the older Command Prompt, and installing Git for Windows adds Git Bash, which works like the shell on Linux and macOS. This module mainly uses PowerShell and says when the others differ.
The line where you type is the prompt. It shows where you are:
PS C:\Users\you\code>PS says this is PowerShell, C:\Users\you\code is the current folder, and > means "type here". Git Bash shows the same place on two lines, as /c/Users/you/code or ~/code, and ends with $. On a Mac the prompt looks like you@Mac code %, showing only the last folder's name.
To ask where you are, type pwd ("print working directory") and press Enter:
PS C:\Users\you\code> pwd
Path
----
C:\Users\you\codeIn Git Bash, macOS and Linux, pwd prints just the path, /c/Users/you/code or /Users/you/code. In Command Prompt, type cd on its own.
The text C:\Users\you\code is a path: directions to a folder or file, one folder at a time. Windows separates the parts with a backslash \. macOS and Linux use a forward slash /, and so does Git Bash. PowerShell accepts both.
A new terminal usually starts in your home folder: C:\Users\you on Windows, /Users/you on a Mac, /home/you on Linux. The shells also write it as ~. Your home folder holds everything of yours: documents, pictures, settings. That is why where you are matters. Commands act on the current folder. When you later start version control with Git in Git on your own machine, running that command in your home folder would make Git watch every file you own. So: look at the prompt, or type pwd, before any command that creates or changes things.
Moving and looking: cd, cd .., ls and dir
ls ("list") shows what the current folder holds. In Command Prompt the command is dir; PowerShell understands both.
PS C:\Users\you\code> ls
Directory: C:\Users\you\code
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 11/23/2026 2:20 PM tool-libraryA d at the start of Mode means a folder (d for directory, an older word for folder). Files have a size in Length. In Git Bash, macOS and Linux, ls prints only the names, such as tool-library.
cd ("change directory") moves you:
| Command | Where it takes you |
|---|---|
cd tool-library | Into the folder tool-library inside the current one |
cd .. | Up one level, to the folder that holds this one. .. always means "the parent folder" |
cd ../.. | Up two levels |
cd ~ | To your home folder (PowerShell, Git Bash, macOS, Linux) |
cd C:\Users\you\code | Straight to that place, wherever you are now |
PS C:\Users\you\code> cd tool-library
PS C:\Users\you\code\tool-library> cd ..
PS C:\Users\you\code>cd printed nothing. The prompt changed, and that is the answer. Many commands work like this: they say nothing when all went well.
A spelling mistake gives an error, and you stay where you were:
PS C:\Users\you\code> cd tool-libary
Set-Location: Cannot find path 'C:\Users\you\code\tool-libary' because it does not exist.Git Bash says it shorter: bash: cd: tool-libary: No such file or directory.
Two habits save a lot of typing and mistakes:
- Tab completion. Type
cd tooland press Tab. The shell fills intool-library(in PowerShell,.\tool-library\). If nothing happens, no name starts that way. - Up arrow. It brings back the command you typed before.
Folder names with spaces need quotes: cd "My Projects". Names without spaces, like tool-library, avoid that.
Creating folders and files
mkdir ("make directory") creates a folder in the current folder. It works in every shell here.
PS C:\Users\you> mkdir code
Directory: C:\Users\you
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 11/23/2026 2:20 PM codePowerShell shows the new folder. Git Bash, macOS and Linux print nothing on success.
Creating an empty file differs between shells:
| Shell | Command |
|---|---|
| PowerShell | New-Item README.md |
| Git Bash, macOS, Linux | touch README.md |
| Command Prompt | type nul > README.md |
touch does not exist in PowerShell. Typing it gives "The term 'touch' is not recognized as a name of a cmdlet, function, script file, or executable program."
An empty file is not much use. To write in it, open it in an editor: notepad README.md on Windows, or open the folder in your IDE (Visual Studio Code, Rider or Visual Studio). With VS Code installed, code . opens the current folder; the dot means "this folder".
You can do all of this in the file explorer too. Right-click in a folder, choose New, then Folder. To go the other way, right-click a folder in Windows 11's File Explorer and choose Open in Terminal: the terminal starts in that folder.
One trap in the Windows explorer: it hides file extensions by default. A file you save from Notepad as README.md can become README.md.txt, while the explorer shows README.md. Turn on View, Show, File name extensions in File Explorer, or check with ls in the terminal, which always shows the full name.
Deleting from the terminal (Remove-Item in PowerShell, rm in Bash) does not use the Recycle Bin. The file is gone. Use it only when you are sure, and only after checking where you are.
Markdown: headings, lists, links and code blocks
Markdown is plain text with a few marks that say how it should look. The file stays readable as text, and tools such as GitHub and your IDE show it formatted. Files end in .md. A project's front page is by custom a file called README.md; GitHub shows it below the file list.
This Markdown:
# Tool library
A small console program that lends out **tools**.
## What a member can do
- Borrow a tool
- Return it
Steps to borrow:
1. Pick a tool.
2. Say how many days.
Read the [Markdown guide on GitHub](https://docs.github.com/get-started/writing-on-github).
See also [the plan](docs/plan.md).
```powershell
cd ~/code/tool-library
```shows a big title, a short paragraph with "tools" in bold, a smaller heading, a bulleted list, a numbered list, two links and a grey box with the command in it.
| You write | You get |
|---|---|
# Title | A level 1 heading. ## is level 2, down to ######. A space after the # is required |
| A blank line between lines of text | A new paragraph. A single line break inside a paragraph is joined into one line |
**bold** and *italic* | bold and italic |
` code ` | code in a fixed-width font, for commands and names |
- item (or *) | A bulleted list |
1. item | A numbered list |
[text](https://example.com) | A link with the text you chose |
[text](docs/plan.md) | A link to another file, with a path from this file's folder |
| Three backticks, a language name, the lines, then three backticks | A code block. The name (powershell, csharp, text) lets the viewer colour it |
To see the formatted result while you write, use your IDE's Markdown preview. In VS Code, open the file and press Ctrl+Shift+V (Cmd+Shift+V on a Mac). Visual Studio and Rider show a preview next to the text. On GitHub, any .md file is shown formatted.
A first Mermaid diagram
Mermaid turns a few lines of text into a diagram. You write it inside a Markdown code block marked mermaid, and viewers that support it draw the picture instead of showing the text. GitHub does, and so does this guide's own diagram at the top of this module.
```mermaid
flowchart LR
pick[Member picks a tool] --> free{Is the tool free?}
free -->|yes| lend[Lend it]
free -->|no| wait[Choose another tool]
```This draws:
flowchart LR
pick[Member picks a tool] --> free{Is the tool free?}
free -->|yes| lend[Lend it]
free -->|no| wait[Choose another tool]flowchart LRstarts a flowchart that runs left to right.TDruns top down.pick[Member picks a tool]is a box.pickis a short name you use for the box; the text in brackets is what it shows.free{...}with curly braces is a diamond, used for a question.-->is an arrow, and-->|yes|an arrow with a label.
Each box is defined once, the first time its name appears; after that you use only the name. If the diagram does not appear, check the first line of the block (it must say mermaid) and look for a typo in an arrow. The Mermaid Live Editor shows the picture as you type and points to errors. GitHub and Visual Studio draw Mermaid diagrams in Markdown; in VS Code you may need an extension, such as Markdown Preview Mermaid Support, depending on your version.
5Worked example
Make the folder for the tool library, the project this guide builds step by step, with a README inside. In PowerShell:
PS C:\Users\you> pwd
Path
----
C:\Users\you
PS C:\Users\you> mkdir code
PS C:\Users\you> cd code
PS C:\Users\you\code> mkdir tool-library
PS C:\Users\you\code> cd tool-library
PS C:\Users\you\code\tool-library> New-Item README.md
Directory: C:\Users\you\code\tool-library
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 11/23/2026 2:20 PM 0 README.mdThe mkdir lines also print a small table like the one for New-Item; it is left out here. In Git Bash, or on a Mac or Linux, the same steps are:
cd ~
mkdir code
cd code
mkdir tool-library
cd tool-library
touch README.md
lsThe last line prints README.md.
Now open README.md in your editor and write:
# Tool library
A small console program for a neighbourhood association that lends out tools: drills, ladders,
lawnmowers. Members borrow a tool for some days and bring it back.
## The idea
- A **tool** has a name, a category and an inventory number.
- A **member** has a name and a member number.
- A **loan** is one tool lent to one member for a number of days.
- The **library** holds the tools and the rules, such as the longest loan allowed.
## How a loan works
```mermaid
flowchart LR
pick[Member picks a tool] --> free{Is the tool free?}
free -->|yes| lend[Lend it for some days]
free -->|no| other[Choose another tool]
lend --> back[Member brings it back]
```What happened:
pwdshowed that the terminal started in the home folder.mkdir codemade a folder for all your projects, so they do not end up loose in the home folder.tool-librarywent inside it.cdmoved the terminal into each new folder, and the prompt followed.New-Item(ortouch) made an emptyREADME.md, and the editor filled it with Markdown: two headings, a list and a Mermaid diagram.
Open the preview: you should see the title, the list with bold words and the flowchart.
6Predict, then run
Write down what each sequence prints, or where you end up, before you run it. Then run it and compare. Start each one in your home folder, after the worked example. The answers explain each result.
Predict 1
cd code
cd tool-library
cd ..
pwdPrints C:\Users\you\code (under the heading Path). The two cd commands went down into code and then tool-library; cd .. went up one level, back to code.
Predict 2
cd code/tool-library
mkdir docs
cd docs
cd ../..
lsWhat does the last ls list, and is docs in it?
The last ls runs in C:\Users\you\code and lists only tool-library. docs was made inside tool-library, so it is not in code. cd ../.. from docs went up twice: to tool-library, then to code.
Directory: C:\Users\you\code
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 11/23/2026 2:26 PM tool-libraryAlso notice that cd code/tool-library used a forward slash and still worked: PowerShell accepts both kinds.
Predict 3
In PowerShell:
cd code
touch notes.md
lstouch fails, and no file is made:
touch: The term 'touch' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.ls then shows only tool-library. In PowerShell the command is New-Item notes.md; touch belongs to Git Bash, macOS and Linux.
Predict 4
How does a Markdown preview show this text? How many paragraphs, and is anything a heading?
#Tools
Drills and ladders.
Lawnmowers too.
Members borrow them.Two paragraphs, and no heading. #Tools has no space after the #, so it is plain text. The next two lines have no blank line between them, so they join the first paragraph: "#Tools Drills and ladders. Lawnmowers too." The blank line starts the second paragraph, "Members borrow them." Fix it with # Tools and blank lines where you want breaks.
7Practice tasks
Type these by hand. Typing them is part of the practice. Solutions are in the answers.
Fill in the gaps (guided)
You are in C:\Users\you\code\tool-library. Replace each ___ so that you create a folder docs, go into it, create an empty file plan.md, check that it is there, and go back to tool-library.
___ docs
cd ___
New-Item ___
___
cd ___mkdir docs
cd docs
New-Item plan.md
ls
cd ..ls shows plan.md with Length 0 (empty). After cd .. the prompt is back at C:\Users\you\code\tool-library.
A Markdown page (partly guided)
In docs/plan.md, write a page called "Plan" with:
- a level 2 heading "Next steps" and a numbered list of three steps (any three you like);
- a sentence with one word in bold;
- a link back to the README (the README is one folder up, so the path starts with
../); - a code block that shows the command
cd ~/code/tool-library.
Check it in the preview, and click the link to see that it leads to the README.
One possible docs/plan.md:
# Plan
## Next steps
1. Write the README.
2. Start version control.
3. Create the console program.
The README is the **front page** of the project.
Back to [the README](../README.md).
```powershell
cd ~/code/tool-library
```The link starts with ../ because plan.md is in docs, one level below the README.
Running project step
Start the running project:
- Open a terminal and check with
pwdthat you are in your home folder. - Make
codeand, inside it,tool-library, as in the worked example. Skip what you already made. - Write the
README.mdfrom the worked example, then add one sentence of your own about who the program is for. - Check that the preview shows the headings, the list and the diagram.
Leave the folder as it is: Git on your own machine starts version control in it.
The commands are those of the worked example; skip a mkdir for a folder you already have (PowerShell says "An item with the specified name ... already exists", and nothing is harmed). Afterwards:
PS C:\Users\you\code\tool-library> ls
Directory: C:\Users\you\code\tool-library
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 11/23/2026 2:20 PM 688 README.md688 bytes is the sample's README; yours will differ with what you wrote. A sample of the finished folder, with the README and the commands, is in the code repository under project/beginner/module-01; its STEP.md lists the commands.
On your own (open)
Draw your morning as a Mermaid flowchart with at least five boxes and one question (a diamond with a yes and a no arrow), for example "Is it raining?". Put it in a Markdown file in a new folder of your own, made from the terminal, together with a heading and a short list of what you need before leaving home.
Any flowchart with a diamond and two labelled arrows will do. An example:
# My morning
Before leaving:
- Keys
- Phone
- Lunch
```mermaid
flowchart TD
wake[Wake up] --> breakfast[Eat breakfast]
breakfast --> rain{Is it raining?}
rain -->|yes| umbrella[Take an umbrella]
rain -->|no| bike[Take the bike]
umbrella --> leave[Leave home]
bike --> leave
```Check: five or more boxes, a {...} question, -->|yes| and -->|no|, and the folder made with mkdir.
8Common mix-ups
| Mix-up | What is true |
|---|---|
| A command acts wherever the file explorer is open | It acts in the terminal's current folder. Check the prompt or pwd first |
| No message means nothing happened | Most commands print nothing when they work. cd changes the prompt; mkdir in Bash is silent. Errors are what get printed |
cd .. goes back to where I was before | cd .. goes up to the parent folder, which may not be where you came from |
touch makes a file everywhere | touch is for Git Bash, macOS and Linux. PowerShell uses New-Item |
| The explorer shows the whole file name | Windows hides extensions by default, so README.md.txt can look like README.md |
| A single line break in Markdown starts a new line | Lines next to each other join into one paragraph. Leave a blank line between paragraphs |
#Heading is a heading | A space is required after the #: # Heading |
| Deleting in the terminal goes to the Recycle Bin | Remove-Item and rm delete for good |
9Self-check
Answer without looking back, then check the answers.
Question 1
What is the current folder, and name two ways to find out which one you are in.
The current folder is the folder the terminal stands in; commands act there unless told otherwise. Look at the prompt (PS C:\Users\you\code>), or type pwd (PowerShell, Bash, zsh) or cd on its own (Command Prompt).
Question 2
The prompt says PS C:\Users\you\code\tool-library\docs>. Which command takes you to C:\Users\you\code?
cd ../.. (up from docs to tool-library, then to code), or cd C:\Users\you\code, which works from anywhere.
Question 3
Why should you check where you are before running a command that creates or changes files?
Because the command acts on the current folder. Run in the wrong place, it creates or changes files there: in your home folder, for example, instead of in the project.
Question 4
Write the Markdown for a link with the text "the README" that leads to README.md in the same folder.
[the README](README.md)
Question 5
What must the first line inside a code block say for a viewer to draw a Mermaid diagram, and what does --> mean in a flowchart?
The code block must be marked mermaid (three backticks followed by mermaid), and the first line inside it names the diagram type, such as flowchart LR. --> is an arrow from one box to the next.
10Review from earlier modules
This is the first module with exercises in this track. Orientation and how to learn comes before it but has nothing to practise yet, so there are no review questions here. From the next module on, each module reviews this one.
11Bridge check
Questions from the intermediate module. If you can answer them, you can read it comfortably. If not, nothing is lost.
Bridge 1
Leads into Absolute and relative paths (intermediate track).
cd C:\Users\you\code works from any folder, but cd code only works from some. Why?
C:\Users\you\code is a full path, starting at the drive, so it means the same place from anywhere. code alone is looked for inside the current folder, so it only works where there is a code folder: in this example, the home folder. The intermediate module calls these absolute and relative paths.
Bridge 2
Leads into Environment variables and PATH (intermediate track).
You type git in a folder that has no file called git in it, and Git still starts. Where do you think the shell found it?
The shell looks through a list of folders kept in a setting called PATH. The Git installer added Git's folder to that list, so git is found from anywhere.
Bridge 3
Leads into Mermaid flowcharts and class diagrams (intermediate track).
A flowchart shows steps. What kind of diagram would you want to show which things a program has (tools, members, loans) and what each one holds?
A class diagram: a box per kind of thing (tool, member, loan), with what each holds listed inside, and lines for how they are connected. Mermaid draws those too, with classDiagram.
12Sources and the date they were checked
All checked 23 November 2026.
- GitHub Flavored Markdown specification: headings need a space after
#(ATX headings), paragraphs and soft line breaks, lists, links, fenced code blocks. - Basic writing and formatting syntax (GitHub Docs): relative links, README files.
- Creating diagrams (GitHub Docs): Mermaid in a code block marked
mermaid. - Mermaid flowchart syntax:
flowchart LR/TD, node shapes, arrows and labels. - Markdown preview in Visual Studio and Markdown in VS Code: preview commands; Visual Studio renders Mermaid. VS Code's Mermaid support has come from the Markdown Preview Mermaid Support extension; whether your version has it built in was not checked.
- Get-Location, Set-Location, New-Item and about_Aliases:
pwd,cd,lsanddirin PowerShell. - Windows Terminal overview: the default terminal on Windows 11.
- Terminal User Guide for Mac: zsh as the default shell on macOS (not run; no Mac was available).
- Every command and its output above was run on 23 November 2026 in PowerShell 7.7.0, Windows PowerShell 5.1, Command Prompt (Windows 11) and Git Bash (Git 2.56.1.windows.1,
git --version), in a scratch folder. Paths are shortened: the scratch folder is shown asC:\Users\you, and repeated tables are left out where the text says so.