🖥️File Path
Also known as Path, Filepath, File Location
The address of a file. It lists each folder from the top, then the file.
Think of it like
Think of it like a street address. Country, town, street, then house number.
Example
Emma's notes sit at the path shown below. From inside her own folder, she can type just notes.txt.
Why it matters
Programs find every file by its path. A wrong slash or one missing folder means file not found.
Definition
Example code
console
$ cat /home/emma/notes.txt
Buy milkCommon mistake
Key takeaways
- 1Top down. Each folder in order, then the file.
- 2Slashes differ. Forward on Linux and Mac, back on Windows.
- 3Absolute or relative. From the root, or from where you are.