Files, folders and paths
🏠The everyday picture
A well-run office has cabinets, drawers inside the cabinets, folders in the drawers and papers in the folders. To tell someone where a paper is, you give its full location: "Cabinet 2, top drawer, folder 'Invoices 2026', the third sheet."
📘What it really is
- A file is one named piece of stored data: a photo, a document, a program.
- A folder (also called a directory) holds files and other folders.
- A path is a file's full address, from the top down:
- Windows:
C:\Users\Asha\Documents\plan.docx -
Mac/Linux:
/Users/asha/Documents/plan.docxNote the slashes: Windows uses\, Mac and Linux use/. Web addresses use/too. -
The file extension after the dot tells the OS what kind of file it is:
.docxWord,.jpgphoto,.htmlweb page,.jsJavaScript,.exeWindows program. -
Hidden files exist too. Programs keep settings in them, often with names starting with a dot, like
.gitor.env. You met one already: the website's protected.gitfolder.
🖱️Try it
Turn on file extensions so you always see them (Windows: File Explorer → View → Show → File name extensions; Mac: Finder → Settings → Advanced → Show all filename extensions). Then find one of your documents and copy its full path (Windows: right-click → Copy as path; Mac: right-click, hold Option → Copy as Pathname).
✅Quick check
A file is called invoice.pdf.exe. Should you open it?
Show the answer
No. Its real type is .exe, a program. Disguising a program as a document is a common trick in harmful
downloads. This is exactly why showing extensions matters.
What's the difference between C:\Projects\site and /home/asha/projects/site?
Show the answer
The first is a Windows path, the second a Linux/Mac-style path. Same idea, different formats.
