11.2 Files Systems and Input/Output
File System: Concepts
Files are where your data is stored. This includes everything from documents to code scripts. These files are organized within folders, also called directories. Importantly, a directory is itself a special type of file that stores a list of other files.
This structure creates a hierarchy, where folders can contain sub-folders, and so on. This is best visualized as a tree, with a root directory at the base and branches leading to nested files and folders. Folders have the function of holding other folders and files.
A path is a sequence of folders to get to a specific file.
- In Linux, paths use forward slashes
/: e.g.,FOLDER1/WORLD.TXT -
In Windows, paths use backslashes
\: e.g.,FOLDER1\WORLD.TXT
FOLDER1/WORLD.TXT
FOLDER2/WORLD.TXT
FOLDER1/HELLO/...
Even on modern devices where you don’t explicitly see this structure (like phones), this hierarchy still exists behind the scenes.