The absolute path (occasionally known as the full path) of an entity contains all the
Different operating systems have different syntax for absolute paths.
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:
C:\Recipes\Pasta\Macaroni
C:\Recipes\Cakes\CheeseCake
C:\Work
C:\Work\AuditReport
Note: Here,
C:\
is the root directory.
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.
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.
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:
https://www.educative.io
https://www.educative.io/answers/
https://www.educative.io/explore
Finally, let’s look at the absolute path to this very shot:
https://www.educative.io/answers/absolute-path
Free Resources