This instance serves as a means to simplify your comprehension.
Windows Path Variances
Windows absolute path
C:\Windows\calc.exe
Windows non absolute path (relative path)
calc.exe
In the illustration above, the absolute path includes the complete file path, whereas the non-absolute path only shows the file name. If you were in a directory without "calc.exe," an error would occur with the non-absolute path. On the contrary, using an absolute path allows you to access "calc.exe" from any directory.
Linux Path Variances
Linux absolute path
/home/users/c/computerhope/public_html/cgi-bin
Linux non-absolute path (relative path)
/public_html/cgi-bin
In these examples, the absolute path discloses the complete path to the cgi-bin directory on the system.
How to ascertain the absolute path of a file in Linux
Typically, users prefer a relative prompt rather than the full path. To acquire the full absolute path of the current directory, utilize the pwd command.
It is advisable to employ relative file paths (whenever feasible).
By utilizing relative file paths, your web pages will not be restricted by your current base URL. Consequently, all hyperlinks will function seamlessly on your computer, local server, and any future public domains you may have.