Wednesday 15 January 2014

Absolute Path Vs Relative Path

Hey,

So my friends whats happening? From  last few days was facing an issue to understand the concept of Absolute Path and Relative Path.

So as per the R&D provinding a simple solution for the same.

Absolute Path, basically the location/address of file from root(/) to the specified location. Or in other words, full path of a file/directory from the root(/).
For an example,
/var/www/operx
/home/user/anupam/Books/PythonBooks/

Relative Path, is the location of file related to the present working directory(pwd). Suppose I am inside /home/user/anupam/Books and want to change directory to /home/user/anupam/Books/PythonBooks.
I can use relative path concept to change directory to PythonBooks by,
/home/user/anupam/Books
cd PythonBooks

Note: If you observe there is no / before PythonBooks which indicates it's a relative directory to present working directory.

Is it possible to change /home/user/anupam/Books/PythonBooks/ using absolute path concept via
/home/user/anupam/Books/PythonBooks/

Hope this is useful.

Thanks.

0 comments:

Post a Comment