Grades 3–5 · Computing
How does a folder path find the right file?
A folder is a container that can hold files and other folders. These containment relationships can be pictured as a tree. The shown folder /class contains art, notes and readme.txt. The art and notes folders each contain a file named map.txt. The repeated filename does not mean the two files occupy the same place.
In the diagramA full path follows a folder tree/classart/notes/map.txtreadme.txt/class/art/map.txtThe same filename can occur in different folders.
A path describes a location by giving the successive names along the tree. In this Unix-style example, slashes separate the names. The complete path /class/art/map.txt follows class, then art, then the file map.txt. The other map file has path /class/notes/map.txt, so its containing folder makes the difference explicit.
An absolute path begins from the filesystem root, the top starting folder, rather than depending on whichever folder is currently open. This makes the location unambiguous within the stated tree. A filename by itself lacks that context. The path identifies where a file is located; it does not describe the file’s contents, size or meaning.
About this explanation
Starting knowledge: Read a simple branching diagram and distinguish a container from an item inside it.
Sources
- University of Michigan, Engineering Research Computing — Intro to Linux: Directory structure and paths