--- layout: page category-page: fs category-title: FileSystem tags: absolute relative path author: Marwan Announ title: fs ---

Relative Path!

Relative path is defined as path related to the present working directory(pwd).
Suppose I am located in /home/user1 and I want to change directory to /home/user1/Documents.
I can use relative path concept to change directory to Documents.


pwd/home/user1cd Documents




Then you could tell me what is the difference between Absolute and Relative.
If you observe, there is a little bit difference, where in relative there is no "/".
Meanwhyle using absolute path you have to write "/", in this case cd /home/user1/Documents.

Example of Relative path's uses:

Now, as we learned from the previous pages we can use other commands in addition to "cat", such as:

pwd
cd .

pwd
cd ..

pwd
cd ..

pwd
cd


and so on.. I know, it's boring but it is one of the disadvantages of not being present in the
working directory

Why Relative Path!?

Now, if you read the last page regarding Absolute path you can ask me, good, but how i can know if is an Absolute or Relative?
If the question is this , you can continue the reading, else please try to do the quiz to verify what you have learn
about path, Absolute and Relative.
Ok, you have to know that Pathnames with no leading slash on the left are called RELATIVE pathnames, so, if you look and there
are no slash on the left you know that is a relative.
For example, "/bar" is not a relative because have slash on the left, but you have to know that relative path can have slash before.
If you observe ../bar have slash, but it's not an asbolute(after the previous reading you have to know why it's not an absolute ;) )