What is a relative pathname? |
|
To refer to a file in a subdirectory of the current working directory,
use the name of the subdirectory followed by a slash (/) and the name
of the file. For example, to display a file called rain
in a subdirectory called red that is located in the
current directory:
% cat red/rain
To refer to a file in the parent directory of the current
directory, use "../" followed by the name of the
file. For example, the pathname "../rowr" would refer to
a file named rowr in the parent of the
current working directory. Pathname "../../b" would
refer to a file named b in the directory two levels
above.
Here is the general procedure for forming a relative pathname:
../" for each level you have
to move up the file tree until you reach a directory that
is above the target.
|
John Shipman, john@nmt.edu
Last updated: 1995/12/04 19:39:34 UT URL: http://www.nmt.edu/tcc/help/unix/relpath.html |
|