This is a discussion on The difference between the paths. within the Shell scripting forums, part of the Development/Scripting category; I want to know the difference between the relative path and the absolute path.Thanks for the replies....
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
| Sponsored Links | ||
|
|
|
|||
|
An absolute path starts at the root of the directory hierarchy, and names directories under it
In the root directory is a directory called bin, which contains a file called ls: /bin/ls Paths don’t have to start from the root directory * A path which doesn’t start with / is a relative path * It is relative to some other directory, usually the current directory P.S the above two are sort of definition. for example if ur right now in the directory /home/gorky/Desktop/resume then u can go access a file in ur /home/gorky directory (say gorky.c) in the following tow ways: 1) vi /home/gorky/gorky.c - that would be an absolute path 2) vi ../../gorky.c - relative path the first ../ takes to the base directory of the current directory u r in ( u r in /home/gorky/desktop/resume/ directory currently and the base of it is desktop). the second ../ takes u to the gorky directory where u have gorky.c. vi is the test editor b) another example is if u want to see the access properties of gorky.c from ur present directory then (ls -l ../../gorky.c) which is an example of relative path ( path relative to u r present directory. |
|
||||
|
Quote:
Wow kavi very nice Clarification!
__________________
Rocky Jr. You may have my body & soul, but you will never touch my pride! If you have knowledge, let others light their candles at it. Certified to work on HP-UX / Sun Solaris / RedHat |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Difference Between SAN and NAS Devices | myfoot | Linux hardware | 2 | 03-24-2008 11:50 AM |
| difference between Swap and Virtual memory | ricc | Linux software | 3 | 03-16-2007 02:35 AM |
| Difference between RUID and EUID. | jithendra | Linux software | 1 | 10-17-2006 06:31 AM |
| difference between Layer 3 switch and Router | puppen | Computer Networking and Internet/broadband | 6 | 06-29-2006 02:45 PM |
| percentage difference between 2 files | stephen | Shell scripting | 1 | 11-17-2005 12:52 AM |