Phase 1 · Operate
Day 2 · Moving Around the Terminal
Day 2

Moving Around the Terminal

~60 min

Goal — Navigate your file system and create the project folder you will use for the rest of the course.

By the end — A my-first-site folder with css and js subfolders, made entirely from the terminal.

Tip

Map first — Where am I in the file system, and where do I want to end up?

1See where you are

Run pwd to print your current folder — the working directory. This answers the first map question: where am I?

Run in the terminal
pwd

2See what is around you

ls lists the files and folders in your current location. ls -la shows everything, including hidden files, with details.

Run in the terminal
ls
Run in the terminal
ls -la

3Move into a folder

cd Documents moves into your Documents folder. Run pwd again to confirm you moved. cd .. goes back up one level — .. always means the folder above this one.

Run in the terminal
cd Documents
Run in the terminal
cd ..

4Create your project folder

Make sure you are in Documents, then create the project you will carry through the whole course and move into it.

Run in the terminal
cd Documents
Run in the terminal
mkdir my-first-site
Run in the terminal
cd my-first-site

5Give the project some structure

Create two folders inside it in one command, then confirm both appear. This is the skeleton of a simple website — a place for styles and a place for scripts.

Run in the terminal
mkdir css js
Run in the terminal
ls

6Practice the file-moving basics

cp source.txt copy.txt duplicates a file. mv oldname.txt newname.txt renames; mv file.txt css/ moves it into the css folder. rm file.txt removes a file.

Important

rm has no undo. Read the name twice before pressing enter.

7Read a file and clear the screen

cat filename prints a file's contents to the terminal. clear wipes the screen clean when it gets cluttered.

Run in the terminal
clear

Recap — You can find where you are, see what is around you, move between folders, and you built my-first-site with css and js inside it — all from the terminal.

Day 1Day 3