diralso ls, Get-ChildItem
Lists what is in a folder. A d at the start of a line means a folder.
dir
Try any command you have learnt on your own pretend computer, drill the commands until they stick, and look one up in the Command Book.
A practice PowerShell on the same files as the lessons. Nothing here can touch your real computer, so try anything: make folders, write notes, walk around. Type help for the list of commands.
Type real commands exactly, as fast as you can. Every letter counts, just like in the terminal. Slow at typing? Practise on TypePlay first.
Command 1 of 8 · 0.0s
pwd
Every command from the lessons so far, what it does, and where you learnt it. The Python words (Levels 4 and 5) and the web words (Level 6) come after the commands. Want the commands on paper? Print the PowerShell cheat sheet.
Lists what is in a folder. A d at the start of a line means a folder.
dir
Walks into a folder. cd .. walks up one folder, cd ~ jumps home.
cd Documents
Says which folder the terminal is standing in: the working directory.
pwd
The same as dir. Add a folder name to peek inside without moving.
ls images
Jumps straight home, to C:\Users\you, from anywhere.
cd ~
Makes a new folder. Use a dash, not a space, in the name.
mkdir games
Makes a new, empty file.
ni ideas.txt
Says words back. With > it writes them into a file; >> adds a line at the end.
echo "Feed the fish" > fish.txt
Shows what is inside a file.
cat fish.txt
Clears the screen. Your files stay safe.
cls
Finishes a file or folder name for you. Type the start, then press Tab.
cd Doc
Brings back the last command, ready to run again.
↑
The emergency stop: cancels the line, or stops a program that runs forever.
Ctrl+C
Makes a twin of a file. The second name is the twin, or a folder to put it in.
copy notes.txt notes-backup.txt
Takes a file on a trip into another folder. It leaves where it was.
move notes.txt backups
Gives a file a new name in the same folder.
ren list.txt shopping.txt
Deletes for good: the terminal has no recycle bin. Look with dir first.
rm junk\old-1.txt
A parameter: says what a command would do, and does nothing.
rm notes.txt -WhatIf
Shows a command and the parts it takes.
help copy
Says which real command a nickname (an alias) runs.
Get-Alias ls
Runs a Python program: a .py file full of steps.
python hello.py
Makes this folder a Git project (a repository), with a hidden .git folder for its save points.
git init
Says what changed: new files, changed files, and what is picked to save.
git status
Picks files for the next save point. A dot picks everything here.
git add .
Makes a save point of the picked files, with a note saying what changed.
git commit -m "Add my ideas"
Shows the save points, newest first.
git log --oneline
Shows what changed since the last save, line by line: red out, green in.
git diff
Undoes the changes to a file since the last save point.
git restore index.html
Visits an old save point. git switch main brings you back.
git checkout HEAD~2
Goes to a branch. With -c it makes a new branch first.
git switch -c dark-mode
Brings a branch's save points into the branch you are on.
git merge dark-mode
Sends your save points to GitHub (on the practice computer, a pretend one).
git push -u origin main
A list of files Git must skip, like secrets and keys. On a real computer, make it in a text editor saved as UTF-8: Windows PowerShell 5.1's > writes a kind of text Git cannot read.
echo secrets.txt > .gitignore
Shows words or numbers on the screen. Words go inside quote marks.
print("Hello!")
A variable: a box with a label. The equals sign puts the value on the right into the box on the left.
score = 10
Maths. One slash gives a decimal, two slashes a whole number, and % what is left over.
print(10 // 4)
Asks a question and waits for the answer. int() turns the answer into a number.
name = input("Your name? ")
An f-string: put f before the quotes, and names in curly brackets fill themselves in.
print(f"Hi {name}!")
A decision. The lines moved in under if run only when its test is True; else runs when none was.
if age > 9:
Comparisons: each one asks a question and gets True or False. One = stores, two == asks.
if guess == 7:
Repeats the lines moved in under it, once for each number in a range or each thing in a list.
for i in range(3):
Repeats while its test is True. Something must change each time, or it never stops.
while lives > 0:
Many values under one name, counted from zero. append adds one to the end.
pets = ["cat", "dog"]
Makes a function: a recipe written once and used again. return hands an answer back.
def double(n):
Brings in a toolbox. random.randint(1, 6) picks a number like a dice roll.
import random
Tags open and close around words: h1 is the biggest title, p a paragraph.
<h1>Hello, web!</h1>
A list: the ul holds it, each li is one item.
<li>Cats</li>
A CSS rule: what to style, then how it looks.
h1 { color: purple; }
One line in the head joins style.css to the page.
<link rel="stylesheet" href="style.css">
Runs a JavaScript function when the button is clicked.
<button onclick="sayHi()">Hi</button>
JavaScript writes a note for coders, under the page.
console.log("Clicked!");
The home page of a site. Its folder holds style.css and images too.
ni index.html
Shows a picture from its path. alt says what it shows, for people who cannot see it.
<img src="images/cat.png" alt="My cat">
DayOneCode is an independent learning site, not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic. PowerShell is a trademark of Microsoft; DayOneCode is not made or endorsed by Microsoft.