A Complete Guide to Web Design

(やまだぃちぅ) #1
Introduction to Unix 51

ServerThe Unix

Introduction to Unix

Web Design in a Nutshell, eMatter Edition

theshell, which interprets the commands you type and invokes the programs you
ask for. You will automatically be placed in your home directory.


To end the telnet session, simply type “logout” or “exit.”


Directory Structures


Because the Web was spawned from the Unix environment, it follows many of the
same conventions. For instance, writing correct URL pathnames in hyperlinks relies
on an understanding of how directory structures work on the Unix platform.


Directories (“places” to store files) are organized into a hierarchical structure that
fans out like an upside-down tree. The top-most directory is known as theroot
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 subdirecto-
ries, and so on. A subdirectory is said to be the “child” of the directory that holds
it (its “parent”). Figure 4-2 shows a system with five directories under the root. The
directoryusershas two subdirectories,jenandrichard. Withinjenare two more
subdirectories,workandpers, and withinpersis the fileart.html.


Apathnameis 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 andrelative.


Absolute pathnames


Anabsolute pathnamealways starts from the root directory, which is indicated by
a slash (/). So, for example, the pathname forpersis/users/jen/pers, as shown in
Figure 4-3.The first slash indicates that we are starting at the root, and is neces-
sary for indicating that a pathname is absolute.


Figure 4-2: Example of a directory hierarchy


/ (root)

bin etc users tmp lib

jen

work pers

art.html

richard

work
Free download pdf