Jump to content

Path (computing)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Altenmann (talk | contribs) at 22:32, 15 December 2003 (cut from "path"). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In computing a path is the general form of a file or directory name. It intends to be a path to a specific file, where they may be many instances of that same file. Paths are a string of characters signifying directories, seperated by a delimiting character, most commonly the slash "/" or backslash character "\", but some operating systems may use a different delimiter.

A path can be either absolute or relative. An absolute path is a path that points to the same location regardless of the working directory or combined paths. It is usually written in reference to a root directory, in the Microsoft Windows operating system this is the current working drive, however in Unix and Unix-like operating systems this is "/".

A relative path is a path relative to the current working directory, so the full absolute path may not need to be given.

To list several paths, a colon ":" is commonly used in the Unix and the like as a separator. A semicolon ";" is used instead in the Windows operating system.

Example

Here is an example with a Unix style file system:

Your current working directory is:

/users/mark/

You want to change your current working directory to:

/users/mark/bobapples

At that moment, the relative path for the directory you want is:

./bobapples

and the absolute path for the directory you want is

/users/mark/bobapples

Because bobapples is the relative path for the directory you want, you may type the following at the CLI to change your current working directory to bobapples:

cd bobapples

Two dots are used for moving up in the hierarchy, to indicate the parent directory, one dot represents the current directory.

See also: Hodology, the study of pathways.

This article is based on material from FOLDOC, used with permission. Update as needed.