nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

The difference between the paths.

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....


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 09-13-2005, 02:57 AM
Gorky
Guest
 
Posts: n/a
Default The difference between the paths.

I want to know the difference between the relative path and the absolute path.Thanks for the replies.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-13-2005, 02:59 AM
Gorky
Guest
 
Posts: n/a
Default

The words ' Thanks for the replies' is an error. I can't rectify. It is not possible to edit the posts.
Reply With Quote
  #3 (permalink)  
Old 09-13-2005, 08:22 AM
Junior Member
User
 
Join Date: Sep 2005
Posts: 24
Rep Power: 0
kavi
Default

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.
Reply With Quote
  #4 (permalink)  
Old 09-13-2005, 03:37 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Quote:
Originally Posted by Gorky
The words ' Thanks for the replies' is an error. I can't rectify. It is not possible to edit the posts.
In order to edit post, take part in poll and to avoid verification number each time you need to be Register user. See url http://cyberciti.biz/nixcraft/forum/...?mode=register to get your account

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
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT +5.5. The time now is 07:11 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36