A computer has many files. You can put them in folders. These folders help you stay neat. It is like a desk with drawers. Folders keep your things in one place. This makes finding things easy. Do you use folders?
Computers have many files. You can put files in folders. This helps you stay neat. It is like a desk with drawers. 
Computers store many files. A directory helps keep them in order. You might know them as folders. A folder is like a drawer in a desk. It holds files or even other folders.
Many computers use a tree shape to organize things. This is called a hierarchical file system. In this system, a folder inside another is a subdirectory. The folder that holds it is the parent. The very top folder is the root directory. It has no parent of its own.
To find a file, the computer follows a path. A path is a list of places to go. 
Computers store many different files every day. A directory is a special structure used to catalog these files. You might know them as folders. This name comes from office folders used to hold papers. A directory can hold references to files or even other directories. This helps keep related things together in one place. It is a way to keep a computer organized.
Many systems use a tree-like way to organize data. This is called a hierarchical file system. In this system, a directory inside another is a subdirectory. The folder that holds the subdirectory is called the parent. The very top directory is the root directory. It has no parent of its own.
People have used different names for this for a long time. The folder idea was used in a machine called the ERMA Mark 1 in 1958. Later, the Xerox Star system also used the folder name. In early Unix systems, the root directory was the home for the root user. Modern Unix systems usually use a different directory for that job. Today, most people use a graphical interface to see folders. This makes it easier to manage files without typing long paths.
Different computer systems handle directories in their own ways. Windows uses special folders to help users find things easily. 
Think about a large library with many different rooms. Each room might have many shelves for different books.
A directory is a vital cataloging structure used by computer file systems. It contains references to other computer files and can also contain other directories.
Most modern computers use a hierarchical file system to manage data. This system is organized like a tree structure. In this model, a directory contained inside another directory is called a subdirectory. The relationship between these two is often described using biological terms. The containing directory is called the parent, while the contained directory is the child.
Directories can be understood through different metaphors depending on how you interact with them. In a graphical user interface, users often see directories as "folders." This visual metaphor uses icons that look like physical office folders. However, there is a technical difference between the two. A directory is a fundamental file system concept. A folder is a graphical representation used to make that concept easier for humans to navigate. Some systems even use "smart folders," which are virtual and reflect the results of a search rather than a physical location in the hierarchy.
History shows how these organizational concepts have evolved over time. The folder metaphor was used as early as 1958. It appeared in the design for the Electronic Recording Machine, Accounting (ERMA) Mark 1. Later, the Xerox Star system also utilized this folder concept. In early versions of the Unix operating system, the root directory served as the home directory for the root user. Modern Unix systems have changed this, usually using a different directory for that specific purpose. In Unix philosophy, the system actually treats directories as a special type of file.
To make file access faster, operating systems use a mechanism called a lookup cache. This process stores information in the computer's RAM, which is much faster than searching the entire disk.
Different operating systems implement these caching and directory methods uniquely. The Linux kernel uses a structure called the dcache within its Virtual File System layer. 
Managing directories becomes more complex in distributed file systems, such as NFS or AFS. In these systems, the cache must remain "coherent" across many different clients. This means that if one user changes a file, the change must be reflected in the caches of all other users.
🖼️ Images & Media (2)
More to explore
✨ What else?
Related topics you might enjoy
🪜 Step back
Simpler topics to build understanding
What is Nepedia?
A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.