What is a file path?
Every file's address
⏱ Est. ~4 min
01 · Read
A path is the address of a file or folder on your computer. Just like a street address tells you where a building is, a file path tells you exactly where a file lives.
💡 Picture thisA file path is like a street address: just like "123 Main Street, Apt 4B" tells you where someone lives, /Users/sara/Documents/resume.pdf tells you exactly where a file is on the computer.
Key points
- Paths use forward slashes / to separate folder names (on Mac and Linux)
- Read paths left to right, from the outermost folder all the way to the file
- Breaking down /Users/sara/Documents/resume.pdf: Users → sara → Documents → resume.pdf
- Special shortcuts: / = the very top (root directory), ~ = your home directory, .. = the parent folder
02 · Build a path
Click through the folders to build the path to resume.pdf. Each folder you click extends the path.
(This section is interactive — please enable JavaScript.)
03 · Fill in the blank
Looking at this path /Users/mike/photos/vacation/beach.jpg — which folder is beach.jpg inside?
04 · Fill in the blank
Looking at this path /Users/mike/photos/vacation/beach.jpg — what's the full filename? (include the extension)
05 · Quiz
If Sara's home directory is /Users/sara, what does the ~ shortcut refer to?
- /Users
- /Users/sara
- /Users/sara/Desktop
- The root directory /
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.