0
0
Intro to Computingfundamentals~6 mins

Folder hierarchy and paths in Intro to Computing - Full Explanation

Choose your learning style9 modes available
Introduction
Imagine trying to find a book in a huge library without any system to organize the books. Computers face a similar problem when storing files. Folder hierarchy and paths solve this by organizing files in a clear, step-by-step structure so you can find anything quickly.
Explanation
Folder hierarchy
Folders are like boxes inside bigger boxes, creating layers of organization. The top folder is called the root, and inside it, there can be many folders, each holding files or more folders. This layered structure helps keep files tidy and easy to locate.
Folder hierarchy organizes files in layers, from general to specific, like nested boxes.
Paths
A path is like a map that shows the exact route to a file or folder inside the hierarchy. It lists each folder you must open, step by step, starting from the root or current location, until you reach the target file or folder.
Paths guide you through the folder layers to find a specific file or folder.
Absolute paths
An absolute path starts from the root folder and shows the full route to a file or folder. It always begins the same way, no matter where you are in the system, so it points to the exact location every time.
Absolute paths always start from the root and give the full location.
Relative paths
A relative path shows the route to a file or folder starting from your current folder. It uses shortcuts like '.' for the current folder and '..' for the parent folder to move around quickly without writing the full path.
Relative paths start from your current folder and use shortcuts to navigate.
Real World Analogy

Think of a large office building with many rooms and cabinets. To find a specific document, you follow signs from the main entrance (root) through floors and rooms (folders) until you reach the right cabinet and drawer (file). Sometimes you start from the entrance, other times from your current room.

Folder hierarchy → Floors and rooms inside the office building, each holding cabinets
Paths → Signs and directions guiding you through floors and rooms to the document
Absolute paths → Directions starting from the main entrance of the building
Relative paths → Directions starting from your current room using shortcuts
Diagram
Diagram
Root
├── FolderA
│   ├── File1.txt
│   └── FolderB
│       └── File2.txt
└── FolderC
    └── File3.txt

Example absolute path: /FolderA/FolderB/File2.txt
Example relative path from FolderA: FolderB/File2.txt
This diagram shows a folder hierarchy with files and examples of absolute and relative paths.
Key Facts
Folder hierarchyA system of organizing folders inside folders to keep files structured.
PathA sequence of folder names that leads to a specific file or folder.
Absolute pathA full path starting from the root folder to a file or folder.
Relative pathA path starting from the current folder using shortcuts to reach a file or folder.
Root folderThe top-level folder in a folder hierarchy from which all paths begin.
Common Confusions
Thinking relative paths always start from the root folder.
Thinking relative paths always start from the root folder. Relative paths start from your current folder, not the root; absolute paths start from the root.
Believing that folders and files are the same.
Believing that folders and files are the same. Folders hold files or other folders; files are the actual data or documents stored.
Summary
Folder hierarchy organizes files in nested folders, like boxes inside boxes.
Paths show the route to find a file or folder, either from the root (absolute) or current folder (relative).
Understanding absolute and relative paths helps you navigate and manage files efficiently.