what is the difference between relative path and absolute
path?

Answers were Sorted based on User's Feedback



what is the difference between relative path and absolute path?..

Answer / raghavendra utsai

A relative path describes the location of a file in
relation to another file on the same current Directory .
The starting point is the location of the document with the
path. The path may appear as:

images/image123.gif

Looking at this path you can tell that the document with
this path is inside of a Current folder which also has a
subfolder named images. And, inside of the images
subfolder, there is a file named image123.gif.

We can Say like, "Stay inside the folder you are already
in and find a subfolder named images. Now look inside of
that subfolder and find a file named image1.gif."

Also known as the full path, the absolute path is a path
that contains the root directory and all other sub
directories required to get into the directory you're
currently in or wish to get to. Below is a basic example of
a generic path and an absolute path.

Absolute path:

/home/user/My Picture/images/image123.gif

As can be seen from the above example, the absolute path
contains the full path instead of a few directories
contained within the absolute path. Below are some
additional examples.

Example 2
Absolute path:
C:\My Picture\images\image123.gif

Is This Answer Correct ?    182 Yes 15 No

what is the difference between relative path and absolute path?..

Answer / suitable

relative path do not begin with /. its specifies location
relative to your current working directory and it can be
used as a shorter way to specify a file name.

absolute path always begin with a / (slash). It is a
complete "road map" file location.

Is This Answer Correct ?    159 Yes 35 No

what is the difference between relative path and absolute path?..

Answer / raveendra reddy

absolute path contains the exact path if anyone wants
to search for the particular file.this path contains all
the root folder information.so, by seeing the absolute path
anyone can easily determine a particular file in our system.
relative path also contains the root folder
information,but we can't determine any file with that
information.if anyone who are there in the root folder or
who knows the root folder only can be determine particular
file.
I think this information is enough to understand.bye

Is This Answer Correct ?    30 Yes 11 No

what is the difference between relative path and absolute path?..

Answer / sudipta

absolute means the path is absolutely present that means the required file's original path, from whenever u r present on ur system.
e.g.
i am finding for a file 'mypic.jpeg' which is present at d:/>my drive/picture & i'm present in the c:/>my document folder,then from that position the absoluute path is
'd:/>my drive/picture/mypic.jpeg'.

But in case of relative path,it indicate the path which is relative to that file(which one u want i.e 'mypic.jpeg') where it is present from that current location ,that may be the same folder,& it casually use when we hosted the file from server,locate the file with in the current folder & that is starting with '\' in windows os..

Is This Answer Correct ?    8 Yes 3 No

what is the difference between relative path and absolute path?..

Answer / masanam

I agree with below example:

Absolute path:
/home/user/My Picture/images/image123.gif

Obsolute path:

images/image123.gif

Is This Answer Correct ?    22 Yes 21 No

what is the difference between relative path and absolute path?..

Answer / ramakant

Absolute path contains parent folders and directory information.

Is This Answer Correct ?    29 Yes 30 No

what is the difference between relative path and absolute path?..

Answer / chandrahas

absolute path: it is complete address with domain name,directory name and file name.
ex: http://www.abc.com/images/img1.jpg

relative path: it is just directory name and file name.
ex: images/imag1.jpg

Is This Answer Correct ?    9 Yes 11 No

Post New Answer

More Unix Commands Interview Questions

How can you see the command line history?

0 Answers  


distinguish between multi-tasking,multi-user,multi- processing and time sharing?

7 Answers   Alcatel, Cisco, Infosys, University Exams,


What Is the command to change a file's creation time. means one file is created at the time 15:19 then time should br changed to 14:14

8 Answers   3i Infotech, IBM,


How do I search for a file in unix command?

0 Answers  


What is the use of touch command in there?

1 Answers   Accenture,






How do I clear my terminal history?

0 Answers  


Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

0 Answers  


What is unix command line?

0 Answers  


what are the different commands used to view the contents of a file?

5 Answers  


Explain command to view process running?

0 Answers  


What are bash commands?

0 Answers  


what is the difference between Touch & cat command

21 Answers   QA,


Categories