|
|
A full pathname (sometimes called an ``absolute pathname'') starts in the root directory and leads down through a unique sequence of directories to a particular directory or file. Because a full pathname always starts at the root of the file system, its leading character is always a / (slash). The final name in a full pathname can be either a file name or a directory name. All other names in the path must be directories. You can use a full pathname to reach any file or directory in the UNIX system in which you are working.
To understand how a full pathname is constructed
and how it directs you, consider the following example.
Suppose you are working in the starship directory,
located in /home.
You issue the pwd command and the system responds
by printing the full pathname
of your working directory: /home/starship.
The following figure and key diagrams the elements of this pathname:
/ (leading) | the slash that appears as the first character in the pathname is the root of the file system |
home | system directory one level below root in the hierarchy to which root points or branches |
/ (subsequent) | the next slash separates or delimits the directory names home and starship |
starship | current working directory |
Diagram of a full pathname
The following pathname:
/usr/bin/sendcauses a search of the root-directory for directory ``usr'', then a search of ``usr'' for ``bin'', finally to find ``send'' in ``bin''. The file ``send'' may be a directory, regular or special file. A null-prefix (or for that matter, any path-prefix without an initial ''/'') causes the search to begin in the current-directory of the user. Thus, the simplest form of pathname, ``alpha'', refers to a file found in the current-directory, and the pathname ``alpha/beta'' specifies the file named ``beta'' in sub-directory ``alpha'' of the current-directory. This relative pathname allows a user to quickly specify a sub-directory without needing to know (or input) the full pathname.
The dashed lines in ``Full pathname of the /home/starship directory'' trace the full path to /home/starship.
Full pathname of the /home/starship directory