I would like to understand what full path name really means. I have a file in my home directory called my_script. I assumed the full path name is ./my_script, meaning that it is in the root folder, but I am not sure. Can someone please enlighten me on that?
No, your assumption is wrong. The full path name for
It is believed that a UNIX path name looks and feels like Internet addresses, thus result into compatibility. The full path name of the current working directory can be found in terminal by using the following command:
To find out the full path for your user home directory, you can use:
The above three commands are equivalent.
To find out the full path name for a file you can use
Full path name really means the full path to that file or folder from the filesystem's
For example, the full path to your script is:
Or, the full path name to the
As for the
In order to understand the full path, you must first know the starting point.
The root directory
User's home directory
Like with directories, files are referenced in the same way, for example a file named
Both files and directories can be referenced/accessed using their full paths from everywhere in the system. Additionally one can access them using only their name if it is in the same directory. For example if the user is at
Additionally one can access directories and files by using their name only, if they are placed at his PATH variable. You can see what is store in PATH by using
Simple examples on how to access files using the command line:
by all means this is just a summary.
The full path name is the path from the root directory (i.e.,
To see the full path of your current directory call
No, it is not. That path is relative. The point at the beginning indicates the current directory:
As you can see, I changed the directory and the
From the Wikipedia: