
#LINUX GET FILE PATH HOW TO#
How to find the absolute path of a file in Linux public_html/cgi-bin is valid only if the current directory contains a path named public_html which contains a directory named cgi-bin. The relative path begins with a dot ( period), representing the current directory (also called the "working directory"). In the example above, the absolute path contains the full path to the cgi-bin directory on that computer. Path differences in Linux Linux absolute path /home/users/c/computerhope/public_html/cgi-bin Linux relative path. In other words, the absolute path is the full directory path plus the file name. For example, if your prompt was "C:\Windows>" and you wanted to know the absolute path of a calc.exe file in that directory, its absolute path is "c:\windows\calc.exe". How to find the absolute path in the Windows command lineįrom the Windows command line, you can find the absolute path of any file by looking at the current directory. These actions would make the file example below have an absolute path of "c:\odesk\computer_hope\chrome.jpg". Next, add a backslash and then the file name to the end of the path.

In the picture below, the location is "c:\odesk\computer_hope". In the file properties first look at the "Location:" which is the path to the file. You can determine the absolute path of any file in Windows by right-clicking a file and then clicking Properties. However, when using an absolute path you can be in any directory and the computer would know where to open the "calc.exe" file. In this example, if you were in a directory that did not contain "calc.exe" you would get an error message. In the example above, the absolute path contains the full path to the file and not only the file name as seen in the non absolute path. Path differences in Windows Windows absolute path C:\Windows\calc.exe Windows non absolute path (relative path) calc.exe
