Skip to content
Home

Folder (computing)

A folder (directory) is a named container used by operating systems and file systems to group files and other folders into a hierarchical namespace for storage, navigation and access.

Overview

A folder, also commonly called a directory, is a named container in a computer file system that groups files and other folders to make storage, navigation and access simpler. Folders provide a hierarchical namespace implemented by the underlying file system and are presented to users by graphical file managers, command-line shells and application interfaces.

Image gallery

1 Image

Structure and basic characteristics

Conceptually, a folder holds references (entries) to files and to other folders. These entries usually store a name and other metadata such as timestamps and permission bits; the exact attributes depend on the operating system and file system implementation. The arrangement of folders typically forms a tree-like hierarchy rooted at one or more top-level directories; this tree metaphor helps users and programs locate items by traversing branches and sub-branches (tree structure).

Most systems support the notion of a current working directory: a folder used as the default location for relative file operations. On Unix-like platforms, a directory is implemented as a special type of file and can be manipulated by the same APIs used for ordinary files, although some operations are restricted (Unix and Linux concepts).

Names and paths

Each folder has a name and a path that locates it in the hierarchy. Paths are either absolute (starting at a defined root) or relative (interpreted from the current working directory). Path syntax and allowed characters vary by operating system and file system; some systems are case-sensitive while others are not. Special path components such as "." and ".." are commonly used to refer to the current and parent folders respectively.

Common operations

  • Create, rename and remove folders.
  • List contents and read or update metadata.
  • Move or copy folders and their contents, preserving or changing metadata.
  • Set access control lists, ownership and sharing properties for multi-user environments.
  • Create links or shortcuts that point to other folders (see symbolic and hard links).

Operating systems provide mechanisms to present the same files or folders in more than one location without duplication. On Unix-like systems symbolic links and bind mounts make a folder appear elsewhere; some other systems offer junctions or shortcuts. File system mounts attach storage devices or remote shares at a folder so that their contents appear as part of the local hierarchy.

Permissions and security

Folders participate in the file system's access control model. Permissions decide who can list, create, rename or delete items within a folder. Modern systems may support fine-grained access control lists (ACLs), role-based controls and inheritance rules that affect descendants in the folder tree. Proper configuration of permissions is important for data protection and multi-user operation.

Virtual folders and special directories

Some environments offer virtual or saved-search folders that aggregate items based on queries or metadata rather than physical containment. Operating systems also define special folders for system use and user data, such as home, temporary and application data directories; conventions and locations differ by OS.

History and metaphor

The folder metaphor was inspired by the physical file folder used to group paper documents. Early graphical user interfaces adopted pictorial folders to help users understand multi-file systems. The core idea—grouping related items into named containers—has been present since the earliest operating systems that managed more than one file.

Uses and best practices

Folders are used to separate system and user data, group project files, implement namespaces for applications and facilitate sharing. Common best practices include using clear, consistent naming conventions; avoiding overly deep hierarchies when possible; and placing configuration and transient data in appropriate special folders. Documentation for a given platform or file system provides details on on-disk structures, recommended layouts and management tools.

For further reading consult platform documentation on file and directory semantics, permission models and namespace design.

Questions and answers

Q: What is a folder?

A: A folder is a storage space or container where computer files can be organized into groups.

Q: Can a folder contain other folders?

A: Yes, a folder can contain other folders.

Q: What is the current working directory?

A: The current working directory is the folder that an application runs in.

Q: In Unix and Linux, what is a directory?

A: In Unix and Linux, a directory is a special type of file.

Q: How are folders laid out in a filesystem?

A: Folders are laid out like a tree, with the folders inside folders being like branches and sub-branches off the trunk.

Q: Can a computer file be in more than one folder directly?

A: No, a computer file can only be in one folder directly, but that folder can be inside other folders.

Q: What is a symbolic link?

A: A symbolic link is a shortcut or link made from one folder to another to make it appear that one file or folder is contained in two different parent folders, similar in function to a hyperlink.

Related articles

Author

AlegsaOnline.com Folder (computing)

URL: https://en.alegsaonline.com/art/35355

Share