Filesystems are hierarchies of directories (also called directory trees) that are used to organize files on computers, on networks, and on storage devices and media (e.g., hard disk drives and CDROMs).
There are two basic types of paths: relative paths and absolute paths. A relative path is the location of a file relative to the current directory. The current directory is the directory in which the user is currently working.
An absolute path, also referred to as an absolute pathname or a full path, is the location of a filesystem object relative to the root directory. The root directory is the directory at the very top of the directory tree that comprises the filesystem on Linux and other Unix-like operating systems and thus contains all other directories and their subdirectories, etc.. Absolute paths always begin with the root directory, and because the root directory is represented by a forward slash, every absolute path always begins with a forward slash.
Forward slashes are also used to separate all items in both relative and absolute paths. When a path ends with a forward slash, it indicates that the last item in the path is a directory.
As an example, a user named jacob would typically have a home directory (i.e., the directory in which the user is first located when logging into a computer) with an absolute pathname of /home/jacob. While working in that directory, the user could refer to files and directories in it by their relative pathnames or by their absolute pathnames. Thus, for example, an image file in that directory could be referred to as either image1.jpg or as /home/jacob/image1.jpg.
Although the location of any file or directory on a system can be described by either its relative path or its absolute path, often it is more convenient to use one or another. That is, when opening or performing some other operation on a file or directory in the current directory, it always requires less typing to use the relative path, whereas when performing some operation on an object that is on a different branch of the filesystem it usually requires less typing to use an absolute path.
A user can always find the absolute path of the current directory by using the pwd (i.e., present working directory) command without any option or arguments (i.e., input data), that is, by typing in the following at the command line (i.e., in all-text mode) and pressing the ENTER key:
URLs (uniform resource locators), which are the addresses of objects on the Internet, employ a filesystem similar to that of Unix-like operating systems, and thus such addresses can also be described in terms of absolute URLs and relative URLs. Consequently, when a URL is included in a web page to another page on the same site, it can be in the form of either an absolute URL or a relative URL; however, when a URL is a link to another site, then it must be an absolute URL.
Paths should not be confused with PATH, which is an environmental variable in Unix-like operating system that tells the system which directories to search for executable (i.e., ready to run) programs in response to commands issued by a particular user. Each user's PATH consists of a series of absolute paths, each separated by a colon. Whenever a user types in a command at the command line, the system searches through the directories listed in that user's PATH until it finds a program with that name.
The list of absolute paths that comprise a user's PATH can be seen by running the echo command with $PATH as an argument:
echo repeats on the display screen whatever follows it on the command line. The dollar sign immediately preceding PATH tells echo to repeat the value of PATH rather than its name.
Created June 15, 2006.