A Complete Guide to Web Design

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

ServerThe Unix

Introduction to Unix

Web Design in a Nutshell, eMatter Edition

Going back up the hierarchy is a bit trickier. You go up a level by using the short-
hand.. for the parent directory. Again, let’s use an example based on Figure 4-2.


If I am currently in thejendirectory, and I want to refer to the directoryrichard /
work, the pathname would be.. /richard /work. The two dots at the beginning of
the path takes us back up one level to the to theusersdirectory, and from there
we find the directory calledrichardand the subdirectory calledwork, as shown in
Figure 4-5.


If I am currently in mypersdirectory and I want to refer to Richard’sworkdirec-
tory, I need to go up two levels, so the pathname would be.. /.. /richard /work,as
shown in Figure 4-6.


Note that the absolute path/users/richard /workaccomplishes the same thing. The
decision whether to use an absolute versus a relative pathname generally comes
down to which is easiest from where you are.


Figure 4-5: Visual representation of the path .. /richard /work, relative to the jen
directory


Figure 4-6: Visual representation of the path .. /.. /richard/work, relative to the pers
directory


current directory

users (..)

jen

work

../richard/work / (root)

bin etc users tmp lib

jen richard

work pers

art.html

work

richard

current directory

users (..)

jen (..)

work

../../richard/work / (root)

bin etc users tmp lib

jen richard

work pers

art.html

work

richard

pers
Free download pdf