Skip to content
KinPilot™Learn & Explore
Menu

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.

D13 visual explanationA fictional folder tree begins at /class. The selected file has absolute path /class/art/map.txt. Slashes separate successive names from the root. The two map.txt files have different containing folders, so a filename alone does not identify one of them.A full path follows a folder tree/classart/notes/map.txtmap.txtreadme.txt/class/art/map.txtThe same filename can occur in different folders.

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.

The highlighted file is /class/art/map.txt, not the separate map.txt inside notes.

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
← Grades 3–5 topics