0 / 91
Week 1 · Day 3 of 91

Files, folders, paths, and extensions

Orientation, CLI, and the Web

Objective

Navigate the filesystem deliberately rather than relying only on graphical file browsers.

Treat the web as a connected system: the browser is a control panel, HTTP is the protocol, the server is the controller, and the database is persistent storage.

  • absolute versus relative paths
  • file extensions
  • current working directory

Why this matters

Every program you write will open, read, and save files, and every one of those operations needs an answer to "which file, exactly?" Today you learn how a computer answers that question — paths, folders, and the idea of where you currently are.

Today is also a human-only checkpoint: no AI assistance. That is not a punishment. The purpose of a human-only checkpoint is to verify you can reason and work through a problem without generated answers — proof that the skill is yours, not the tool's. Navigating a filesystem only gets into your fingers by doing it unaided, and if you cannot move around one without help, every later day gets harder in a way that is hard to diagnose.

Folders, files, and the tree

A filesystem is a tree. One folder contains files and other folders, each of which contains more, and so on down. Folders are also called directories — same thing, and the command line prefers "directory".

home/
└── fullstack-journey/
    ├── setup-notes.md
    └── notes/
        └── day-03.md

Two rules that follow from the tree shape: every file sits in exactly one folder, and its full identity is the whole chain of folders leading to it — not just its name. Ten files can be called README.md with no conflict, as long as they are in different folders.

Reference designators

A schematic has many resistors called R1. What makes one unambiguous is the board it is on: board A, R1 is a different component from board B, R1. A file path is the same idea — the name alone is not the identity, the location plus the name is.

Where you are: the working directory

The terminal is always inside one directory, called the current working directory. Commands that mention files look there first. This is the single most important thing to know about the terminal, and the source of most beginner confusion: the same command gives different results depending on where you are standing.

pwd — "print working directory" — tells you where you are:

pwd
/Users/you/fullstack-journey

Standing in a room

The working directory is the room you're standing in. "Pick up the blue folder" means the one in this room. Walk to another room and the same sentence refers to a different object — or to nothing at all. pwd is looking up at the room number on the door.

Absolute vs. relative paths

A path is the text that identifies a file or folder. There are two ways to write one.

An absolute path starts from the root of the tree and gives the complete chain. On macOS and Linux it starts with /; on Windows with a drive letter like C:\.

/Users/you/fullstack-journey/setup-notes.md

It means the same thing typed from anywhere. Complete, unambiguous, long.

A relative path starts from wherever you currently are.

setup-notes.md
notes/day-03.md

Short and convenient, but it only means something in the context of your working directory.

Two special names appear in relative paths everywhere:

Symbol Means
. the current directory
.. the parent directory, one level up
~ your home folder (a handy shortcut)

So ../setup-notes.md means "go up one level, then find setup-notes.md".

Ten seconds, right now

Run pwd, then cd .., then pwd again. Watch the path get shorter by one segment. Then cd - to jump back to where you were. You just moved up the tree and back.

File extensions

The end of a filename after the last dot — .md, .js, .json, .html — is the extension. It is a convention, a hint about what the file contains, not an enforced rule. Renaming photo.jpg to photo.txt does not change a single byte inside it; it only misleads the programs that trust the name.

Extensions matter because tools use them to decide behaviour: your editor picks syntax colouring by extension, and Node decides how to treat a file by whether it ends in .js or .json.

Hidden extensions lie to you

macOS Finder and Windows Explorer hide known extensions by default, so notes.md may display as notes, and a file that looks like report.pdf might really be report.pdf.exe. Turn extensions on — Finder → Settings → Advanced → "Show all filename extensions"; Explorer → View → "File name extensions". The terminal always shows the truth.

Walkthrough: the six commands

Open your terminal and follow along. These six do almost all day-to-day navigation.

cd ~                  # go to your home folder
pwd                   # where am I?
ls                    # what's in here?

ls lists the contents of the current directory (dir in Windows PowerShell also works). ls -la shows more: hidden files and details. The -la part is a flag, an option that changes what a command does — Day 4 covers flags properly.

mkdir path-practice   # make a directory
cd path-practice      # move into it
pwd                   # confirm you moved

mkdir makes a directory; cd changes directory. Notice you confirmed the move with pwd rather than assuming — the Day 2 habit, applied.

touch hello.md        # create an empty file
ls                    # confirm it exists

touch creates an empty file if it doesn't exist. (Windows PowerShell: New-Item hello.md.)

rm hello.md           # delete the file
ls                    # confirm it's gone

`rm` does not use the Recycle Bin

Files removed with rm are gone immediately — no trash, no undo. Only ever run it on paths you have read carefully, and never with a path you don't fully understand. Practise on disposable folders like this one, which is exactly why today's lab uses a throwaway directory.

Checkpoint

You should be able to say what each of pwd, ls, mkdir, cd, touch, and rm does, in your own words, without looking at this page.

Your turn

Do this without AI assistance and without copying from above — look away from the screen and use --help or your memory when stuck.

  1. From your home folder, cd into fullstack-journey. Confirm with pwd.

  2. Create a folder called notes and another called experiments.

  3. Create a README.md at the top level of fullstack-journey.

  4. cd into notes, create day-03.md, then return to fullstack-journey using a relative path (..), not an absolute one.

  5. Inside experiments, create a disposable folder scratch, put two files in it, then delete both with rm and remove the folder with rmdir scratch.

  6. Run ls -la at the top of fullstack-journey and check your tree matches:

    fullstack-journey/
    ├── README.md
    ├── setup-notes.md
    ├── experiments/
    └── notes/
        └── day-03.md
    
  7. Now the real exercise: close the terminal, open a fresh one, and recreate the same structure from memory in a folder called path-practice-2. Delete it when you're done. If you had to look something up, do it once more.

Common pitfalls

  • Running a command in the wrong directory. The command works, the file lands somewhere unexpected. Run pwd before anything that creates or deletes.
  • Spaces in names. cd my folder reads as two arguments and fails. Quote it — cd "my folder" — or avoid spaces entirely. Prefer my-folder.
  • Confusing / at the start. /notes is an absolute path from the root of your whole disk; notes is a folder here. That leading slash changes everything.
  • Assuming rm is recoverable. It isn't. Read the path twice before Enter.

Verify it yourself

Open today's reference, MDN's Command line crash course, and find its section on navigating the filesystem.

  1. MDN lists a couple of navigation commands this lesson did not cover. Find one and work out what it does from the docs alone — no AI.
  2. Does MDN describe the working directory the same way this lesson did? Find the sentence.

Write the extra command and your own one-line definition into notes/day-03.md. Learning a tool from its documentation, unaided, is the skill today is really testing.

The hour

  1. 0–5 min Recall

    Without notes, state yesterday’s main idea and one unresolved question.

  2. 5–20 min Learn

    Read only the listed concept notes and official reference sections needed today.

  3. 20–48 min Build

    Use pwd, ls, mkdir, cd, touch, and rm on a disposable practice folder. Recreate the final structure without looking.

  4. 48–55 min Explain and verify

    Run the result, inspect evidence, and explain the data/control flow in your own words.

  5. 55–60 min Quiz and commit

    Complete the quiz, record one lesson, and commit the verified change when applicable.

What to hand in

Deliverable

A practice tree with notes/, experiments/, and README.md.

Working with AI today

Human-only checkpoint

Do the core exercise without AI. Use documentation and debugging evidence. AI may review only after completion.

References

End-of-day quiz

Q1 What does pwd print?
Q2 Which result best proves today’s work is complete?
Q3 What is the purpose of a human-only checkpoint?

Explain-back gate

Pass the quiz above to unlock completion.

Quiz + explain-back checks required.