what is the difference between relative path and absolute
path?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?

765


Name the general commands in using unix os for a beginner?

626


What is used to type command?

547


Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?

963


Write a command that will display files in the current directory, in a colored, long format.

689






What is the use of the tee command?

602


Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?

594


Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.

628


What are the general commands in using unix os for a beginner?

583


Which command is used to restrict incoming messages?

594


Explain the steps that a shell follows while processing a command.

683


What command will change your prompt to myprompt?

709


What does this command do,"$more readme.txt“?

693


What will the following command do?

621


How do I run a bash script?

588