absolue and relative pathnames featured image

Absolute and Relative Pathnames | . and .. folders

Hey Techie,

Today I am going to share one of the best concepts that I learned about Absolute and Relative Pathnames. Sometimes when I used to write programs, I had to provide the path of the files and I used to have a lot of trouble.

Absolute Path:

C:\Users\shivam kumar

Relative Path:

shivam kumar

An absolute path starts from the location of the root directory, in the above example, the root directory is “C” drive followed by “\” (backward slash). The relative path only contains the name of the folder or files inside the current working directory, like in the above example the relative path is “shivam kumar”.

Suppose, if you are in a directory that doesn’t contain the “shivam kumar” folder or file whatever it is then you will get an error message. So, in this case, you need to provide the full path of that particular file.

How to get Absolute Path?

Right click on any folder > click on “Properties” > Check the “location”

“C:\Users\shivam kumar\Desktop\screen shots” is the absolute path of the particular folder.

Also Read: How to add path in Window 10?

What is . and .. folders? How to use it

In the process of providing the paths, “.” refers to the working folder(or working directory), and “..” refers to the parent directory. And the most important thing is both “.” and “..” is used for relative path and NOT for absolute paths.

absolute and relative pathnames explanation of . and .. folders path

In the above figure, you can see that I have given a directory tree and written both Absolute and Relative Pathnames for every file and folder. I hope it will be helpful for understanding the basic concepts of the path of every directory in our computer system.

You can also read:

Thank you very much for reading this article. If you have any suggestions regarding this, please write in the comment box. I would love to hear you.

8 thoughts on “Absolute and Relative Pathnames | . and .. folders”

  1. Hi there, after reading this remarkable post i am too happy to share my experience here with colleagues. Norri Neron Katerine

  2. What a information of un-ambiguity and preserveness of valuable knowledge on the topic of unexpected emotions. Kiley Preston Prue

Leave a Comment

Your email address will not be published. Required fields are marked *