Unix Directory Structures
Because the Web was spawned from the Unix environment, it follows many of the same conventions. Directory structure and pathname syntax are prime examples. It is important for all web designers to have an understanding of how directory structures are indicated on the Unix platform since pathnames are used in hyperlinks and pointers to images and other resources.
Directories (“places” to store files) are organized into
a hierarchical structure that fans out like an upside-down tree. The
topmost directory
is
known as the root and is written as a forward
slash ( / ).
The root can contain several directories,
each of which can contain subdirectories; each of these can contain
more subdirectories, and so on. A subdirectory is said to be the
“child” of the directory that holds it (its
“parent”). Figure 4-1 shows a system
with five directories under the root. The directory
users has two subdirectories, jen
and richard. Within jen
are two more subdirectories, work and
pers, and within pers is
the file art.html.

Figure 4-1. Example of a directory hierarchy
A pathname is the notation used to point to a particular file or directory; it tells you the path of directories you must travel to get to where you want to go. There are two types of pathnames: absolute and relative.
Absolute Pathnames
An absolute pathname always starts from the root directory, which is indicated ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access