Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

absolute
directory
file
website

What is absolute path?

Anusheh Zohair Mustafeez

The absolute path (occasionally known as the full path) of an entity contains all the informationfrom the root to the ending needed to locate that entity. Absolute paths are used to trace the location of files, folders, or webpages.

svg viewer
An example of directory structure

Absolute path in file systems

Different operating systems have different syntax for absolute paths.

Windows

The illustration above depicts a directory structure in a Windows environment. Below are the absolute paths to some files and folders in the sample directory:

  • Macaroni file: C:\Recipes\Pasta\Macaroni
  • Cheese cake file: C:\Recipes\Cakes\CheeseCake
  • Work folder: C:\Work
  • Audit report file: C:\Work\AuditReport

Note: Here, C:\ is the root directory.

Linux/Unix

Below is an example of an absolute path to a file stored on a Linux/Unix system:
/home/Educative/Courses/Python.txt

Note: Here, / refers to the root directory.

Mac OS

Finally, let’s look at an example of an absolute path to a file stored on a Mac OS system:
/Users/Sarah/Desktop/Educative/Courses/Java.txt

Note: Here, / refers to the root directory.

Absolute path in websites

Websites also have absolute paths. URLs hold the information to a website’s path and are usually visible on your browser’s search bar. Let’s use Educative’s website as an example. Below are the absolute paths to land on different webpages of Educative’s website:

Finally, let’s look at the absolute path to this very shot: https://www.educative.io/edpresso/absolute-path

RELATED TAGS

absolute
directory
file
website

CONTRIBUTOR

Anusheh Zohair Mustafeez
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring