Nepedia
Back to Discover
Fluent Reader
💻

Directory (computing)

technology Maturity 7-9 Next article →

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.

Files11 directory hierarchy
Files11 directory hierarchy

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.

Files11 directory hierarchy
Files11 directory hierarchy

To find something, the computer follows a path. A path is a reference to a specific location. Most files can only live in one directory at a time.

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.

Dir command in Windows Command Prompt
Dir command in Windows Command Prompt

Linux uses a structure called dcache to help the system work fast. This dcache stores directory entries in the computer's memory. Other systems like macOS and BSD also use lookup caches. These caches help the computer remember paths. This means the computer does not have to search the whole tree every time.

Think about a large library with many different rooms. Each room might have many shelves for different books.

Files11 directory hierarchy
Files11 directory hierarchy

The directory is like the library's catalog system. It tells you exactly which shelf holds your book. Some programs even have a working directory. This is like a desk where a librarian stays to work. If a program needs a file, it looks at that desk first. This makes finding information much faster for the computer.

372 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (2)
File:Dir command in Windows Command Prompt.png
Dir command in Windows Command Prompt.png
File:Files11_directory_hierarchy.svg
Files11_directory_hierarchy.svg
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 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.