Directories are named by their contents. When the contents are homogenous (elements of the same type) we use a plural label (e.g. Documents, Pictures). When the contents are heterogenous (elements of various types) we use their common function or theme to describe them with a singular label (e.g. Library, Desktop).
Directories exist to group a set of files together. Even if a directory is currently empty, it represents such a group, just that there are currently no files in this group and that's why it is empty. So the name of a directory should always describe what can be found find within that directory.
As a general rule of the thumb: Directories should be always named in such a way that the reader of the directory name has a very good idea of what kind of files and other directories they can expect to find inside that directory, so they can decide whether it's interesting to check it or not by just having read the directory name.
But content of a directory can vary a lot and a name for one directory might not fit another. Imagine a box of pencils. How would you label it? "Pencils", right? What if this box contains some paper and erasers as well? In this case a fitting name would be "writing", so that it is clear that the box contains things used for writing.
Now let's look at that big box of stuff you pull out at Christmas time. If the box contains only Christmas tree ornaments it makes sense to label it "ornaments", by the type of its content. However, more often than not it contains an assortment of stuff like tinsel, baubles, stockings, wrapping paper and fake snow. In this case the name "ornaments" would not properly describe the content of the box, and it is much easier to just label it "Christmas" instead, according to its purpose and theme.
We face similar problems when naming directories.
When naming boxes or directories, we have to pay attention to the grouping of elements that it contains. Often we group elements together because they are of the same kind, much like "pencils" and "ornaments". But sometimes we group items together, not because they are of the same kind but because they belong to the same "thing" - they belong to the same function, to the same project or simply to the same umbrella term. In the above cases all of the containing elements of the first box can be used for "writing" and the elements of ths second box belong to the "Christmas" theme.
Content of a directory can be categorized as homogenous or heterogenous.
Homogenous directories contain files that are of the same kind, of the same type. A good example is a directory that contains only images. Such a directory can be reasonably named / labeled "pictures". Same goes for directories that contain "videos", "documents" or "passwords".
In such cases the directory name is a plural form of the specific type of files contained.
Heterogenous directories on the other hand contains an assortment of files (and often other directories) that are not of the same type or the same kind. It is possible to describe all of the elements in there with a broad type, such as "objects", but that is not very descriptive. In these cases the function or theme better describes the elements and such directories get named "Christmas", "library", "desktop" and "user".
In such cases the directory name is a singular form describing the theme of files contained.
Sometimes there is an ambiguity in categorizing the content. In such cases there is no rule other than common sense in terms of what better describes this content.
From a perspective of a reader.
If you name a directory "Recipe", what will the reader expect to find inside? In there I would expect to find one or more files of different types, all belonging to a single recipe, e.g. a short ingredient list, a longer instruction text and maybe some supporting photos.
Contrary, if you name the directory "Recipes", what will the reader expect? I would expect that all elements in it are of the same type: recipes. There could be either multiple files and every file contains one recipe or multiple sub directories and each one contains the files that belong to one recipe.
As it is visible this simple example, whether you choose plural or not has an effect on the expectation of the reader.
Keep in mind how much information the reader already has. One can reasonably argue for each of the following directory names
/unit15/boxes
/unit15/shoe_boxes
/unit15/shoes/boxes
The first directory is only meaningful if the reader already knows that the content of boxes is about shoes. Without that information, the boxes might, for all we know, contain venomous snakes. The second and third directory are much more descriptive, but include redundant information in case the content of boxes is obvious.
The latter is obvious in an example, if the directory strucutre is inside a computer of a shoe store
https://shoestore.com/unit15/boxes
A parent directory's name plurality has no effect on the plurality of its subdirectories' names. A subdirectory can define a more precise type of elements or it can introduce a new groupping.
Although, a common convention is to keep all sibling directories of the same type; if one directory is named based on a type of elements, so should all sibling directories describe different types, and if one directory describes the theme groupping, so should the other sibling directories.
/pictures <- parent directory
/pictures/animals <- more precise type of pictures: pictures of animals
/pictures/birthday_party <- new groupping of pictures which belong to the birthday party
This above directory structure shows us that subdirectories can have any plurality. But in above directory structure a reader would have no idea where to look for a picture of a dog taken at the birthday party. A much better approach is shown below, where all sibling directories are of the same type and the subdirectories explore the other type.
/pictures/animals/birthday_party
/pictures/cars/dealership
/pictures/cars/birthday_party
or
/pictures/birthday_party/animals
/pictures/birthday_party/kids
/pictures/dealership/cars
This also tells us that any order is logically plausible as long as the directory structure is clear. A picture of a dog taken at the birthday party can be equally logically found in the direcory /pictures/animals/birthday_party
or /pictures/birthday_party/animals
.
Sometimes the web servers organize their directory structure to look like a sentence. This is best illustrated by an example:
https://www.acme.com/buy/rocket/launcher/x3000
While each category could be plural, the path reads more like an English sentence by using singular directory names. This seems a bit forced perhaps, but it looks neat.
Back in the days, the directories used to have a prefix or a suffix, like "f_" or "_f", so that the user immediatelly knows whether an element is a file or a directories. Nowadays, this is not so relevant anymore, since we often use GUI (like File Explorer) for browsing files and directories and with them we can easily distinguish between them based on their accompanying icons. When using CLI these could stil be relevant, but even in those cases we can use flags that show those properties as well (ls -a
).
Sometimes you might be tempted to name a directory with a secret name that only you will recognize. Trust me. After a few years and a few thousand directories, even you will not recognize your own directories.
Same goes for leaving default names (such as "New folder") and trying to remember them.