A subdirectory is part of a hierarchical file system. It represents a directory that is part of another directory, whether it was created or otherwise moved to be there. A subdirectory can contain files and other subdirectories – in theory, an indefinite chain of subdirectories in parent directories can exist on most devices, but in practice, it’s usually limited to nine. The main limitation is disk space – wherever the subdirectory is located, space is consumed by each of them, and eventually, that space runs out.
Technipages Explains Subdirectory
When any sort of disk is formatted, be it a CD-ROM, hard drive or USB stick, a fixed-size root directory is created. It is only big enough to contain 512 files in total. If anything bigger than that is to be added, subdirectories need to be created, where they can then be filled with more content. Subdirectories are not fixed-size – they can fit as many files as needed.
In addition to allowing more files to be stored on a hard drive, subdirectories also serve an organisational purpose – for example, rather than storing 10.000 photos in one directory, it makes more sense to sort them and divide them by something, such as location or month in which they were taken. For each of these units, say location, a new subdirectory is created, and the photos are then sorted accordingly. This way, it’s a lot easier to find an individual photo in what would otherwise be an overwhelming mass of images. Directories and subdirectories are a great way to build a tree-like structure to sort and store content.
Subdirectories can be nested into one another or exist at the same level – a directory can contain three subdirectories, each of which can contain five more, for example.
Common Uses of Subdirectory
- Subdirectories are a great tool for organised file storage.
- Nesting too many subdirectories can get confusing – sometimes less is more.
- Due to the limitation of how many subdirectories can be placed within one another, efficiently naming them is always a good idea.
Common Misuses of Subdirectory
- Subdirectories allow for additional space in a hard drive to be made available.