Relative Path

Meaning – The term relative path, refers to a path that begins with the working directory. Alternatively referred to as a partial path or non-absolute path, a relative path is a URL that only contains a portion of the full path. Its complete location is based on its relation to the directory where it is linking.

A path can either be relative or absolute. A relative path defines a location that is relative to the current directory or folder.

Absolute paths are defined from the root directory of the file system. This means no matter what folder is currently open, the absolute path to any given file is the same.

Example of usage“The relative path to a file named “document.txt” located in the current directory is simply the filename, or “document.txt”. If the file was stored inside a folder named “docs” within the directory, the relative path would be “docs/document.txt.”