By the end of this lesson you will read any file path the AI gives you, on Windows, Mac or Linux, and know exactly which folder it points to.
You need: your laptop and its file manager (File Explorer on Windows, Finder on Mac, Files on Linux) · Time: 7 minutes
A coding agent does not build "an app" in the air. It writes files (single documents, like
index.htmlornotes.txt) inside a folder (a box that holds files and other folders). Your whole project is one folder.So the agent will say things like "open
src/app/page.tsx" or "run this in the project folder". If you know how files, folders and paths work, those sentences stop being scary and start being directions.Think of your laptop like a big almirah: the disk is the almirah, folders are the shelves and boxes, files are the papers inside. A path is the note that says "almirah → second shelf → blue box → fees receipt".
Why?Most "it did not work" moments for beginners are really "it ran in the wrong folder". Knowing where a file lives fixes them before they happen.
Most file names end with a dot and a few letters:
fees.xlsx,notes.txt,photo.jpg. That ending is the extension. It tells the computer (and you) what kind of file it is and which app opens it.Windows and Mac hide extensions by default. Turn them on once, because the AI will talk about
package.json,.envandREADME.mdall the time:- Windows 11: open File Explorer, then choose View > Show > File name extensions.
- Windows 10: open File Explorer, open the View tab and tick File name extensions in the Show/hide group.
- Mac: in the Finder choose Finder > Settings, click Advanced and select Show all filename extensions.
- Linux: most file managers already show the full name.
Match them Match each extension with what kind of file it is
Tap an item on the left, then its meaning on the right.
Why?With extensions hidden,
invoice.pdf.exelooks likeinvoice.pdf, andpackage.jsonlooks like a mystery file calledpackage. Seeing the real name keeps you safe and lets you follow the AI.A path is the full address of a file: every folder you open, from the top of the disk down to the file. Here is one file,
notes.txt, inside atuition-feesfolder, insideprojects, inside Asha's home folder:Each folder is a box inside the box above it. The path lists the boxes in order. The same file, written three ways:
- Windows:
C:\Users\Asha\projects\tuition-fees\notes.txt. It starts with a drive letter (C:) and uses backslashes\. - Mac:
/Users/asha/projects/tuition-fees/notes.txt. It starts at/(the top of the disk) and uses forward slashes/. - Linux:
/home/asha/projects/tuition-fees/notes.txt. Same idea; home folders live in/home.
A path that starts from the very top (a drive letter or
/) is an absolute path: it works from anywhere. Your home folder is the folder with your user name (C:\Users\Asha,/Users/asha,/home/asha); your Documents, Downloads and Desktop live inside it.Prompt · copy it into your AI agentBefore you change anything, tell me the full absolute path of the folder you are working in, and list the files and folders directly inside it. Do not create, change or delete anything.
Why?When the agent prints a path, you can now check it is the project you meant, and not your Downloads folder or someone else's copy.
- Windows:
Typing full paths gets long, so terminals understand three short forms:
~means your home folder.~/projectsis theprojectsfolder inside your home folder (this works in PowerShell too)..means the folder you are in right now.code .opens "this folder" in VS Code...means one folder up (the parent box).cd ..steps out of the current folder.
A path that starts from where you are, like
notes.txtor../fees.xlsx, is a relative path: it only works from the right folder. In our drawn terminals, the line starting with$is what you type (don't type the$itself), and the lines under it are what the computer prints:Why?When the AI says "run it from the project root" or "go up one folder", it means exactly these moves. A relative path depends on where you are standing.
Spaces and odd characters in names cause trouble in the terminal, because a space is how the terminal separates one word from the next:
Simple rules for every folder and file you create:
- Use lowercase and hyphens:
tuition-fees,chai-stall-stock, notTuition Fees (final) NEW. - No spaces, no
&,#,%or emojis. - Keep projects in one place, like
~/projects. On Windows, avoid OneDrive folders (why). - Linux treats
Notes.txtandnotes.txtas two different files. Stick to lowercase and you never have to think about it.
Why?Good names cost nothing and save you from a whole family of confusing errors. Web addresses and many tools also break on spaces.
- Use lowercase and hyphens:
- A project is a folder of files; the agent reads and writes those files.
- Turn on file extensions so you see
package.json,.envandREADME.mdby their real names. - An absolute path starts at the top (
C:\or/); a relative path starts where you are. ~is home,.is here,..is one folder up.- Name things in lowercase with hyphens, no spaces.
- Next: open a terminal and read it.
Create a free account to save your progress and open every lesson. Create free account