Where is Grandma Ruth’s apple pie recipe, exactly?
Lesson 18.1 · Where Is It?
Jenny · Sarah
/home/ruth$ and a blinking cursor.
Jenny’s black window shows one line: /home/ruth$.
Sarah asks what that means. Jenny says it’s where they’re standing: inside a folder called ruth, inside a folder called home.
Every file on a computer is somewhere in a big tree of folders like that, and the recipe is in there somewhere.
Sarah types her first command.
Try it yourself
Use the command line to find Grandma Ruth’s apple pie recipe.
1 of 5 Type pwd to see which folder you’re in.
Try: pwd, ls, cd <folder>, cd .., cat <file>
What you just did has a name
Files and folders
A file is a named chunk of data stored on a drive: a photo, a document, a song, a program.
The operating system keeps a list of every file’s name, size, type and where its data sits on the drive.
Folders, also called directories, group files and other folders into a tree, starting from one top folder.
The file manager you click around in, like File Explorer or Finder, is a picture of that tree.
A few more things
The extension says the type
The letters after the dot, like .jpg, .txt or .docx, tell the operating system which app opens the file. Changing them doesn’t change what’s inside.
Folders are just lists
A folder doesn’t hold the files’ data. It’s a list of names pointing to where the data is on the drive.
Same tree everywhere
Windows, Mac and Linux all organize files as a tree of folders. They just draw it and name the top a little differently.
Go deeper
The longer version, if you want it.
The file system
The part of the operating system that keeps track of files is called the file system. It manages the list of names and locations, and the map of which parts of the drive are in use and which are free. Common ones include NTFS on Windows, APFS on Macs and ext4 on Linux.
The FAT32 format from Module 5’s Fix-It Card is an old file system, and its 4 GB limit is a side effect of how it stores each file’s size.
Quick check
What does a folder actually store?
Let’s take it slower
Think of a library. The books are the data, sitting on shelves. The catalog tells you each book’s title and which shelf it’s on. Folders are sections of the catalog: Cookbooks, then Pies. The file manager is a friendly way of browsing that catalog, and the command line is asking the librarian directly.
More examples
Your Downloads folder
Everything you download lands in one folder by default. That’s why it fills up with mystery files nobody remembers.
A history essay folder
A folder called History holds a folder called Essay, which holds draft-1, draft-2 and final-really-final. Each file sits in exactly one spot, and the folders are just a way of saying where. That’s the whole tree.
Back to the question
So where is the recipe, exactly?
Show the answer
In a file called apple-pie.txt, in a folder called Recipes, in Documents, in ruth, in home, at the top of the drive. Sarah found it in a handful of commands. The secret ingredient is cinnamon, which she has been sworn not to share.
One last question
Grandma Ruth asks what a file actually is. Who got it right?
Talk Card
Talk Card · 18.1
File Explorer and Finder are just pictures of a tree of folders. Every file has a path from the top of the tree down to where it lives.
How Computers Work · pettigrewlab.com/learn

