Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-10-2006, 04:24 AM   #1
Registered: Oct 2005
Posts: 123

Rep: Reputation: 15
periods in relative paths?

i have a perl script setup that says:
cgi-bin (relative)
enter relative from proframs root directory, e.g. ../cgi-bin

Well my server serves web pages out of the public_html
so my structure is /home/domain_name/public_html/cgi-bin

So what do the .. mean, would I just put /cgi-bin in this type of structure, meaning down one level of directories, or would I leave out the .'s all together in this type of structure?

Old 01-10-2006, 04:56 AM   #2
Registered: Mar 2005
Location: Dresden, Germany
Distribution: OpenSuse 11.2/3, Debian 5.0 , Debian 1.3.1, OpenBSD
Posts: 277

Rep: Reputation: 32
.. stands for "one nod up in the directory tree". A single. mean "this directory". initiating something with a backslash / means "relative to the root directory", without the backslask means "relative to current directory".

/usr/share/doc is where you are now. there are, among other, directory nodes to /usr/share/doc/kde and /usr/share/doc/gnome.

../ = /usr/share
./ = /usr/share/doc
./kde = /usr/share/doc/kde (=kde)

use the cd command in a console to experiment around with this stuff. Its really basic and really important!!!

Last edited by ichrispa; 01-10-2006 at 04:59 AM.
Old 01-10-2006, 05:19 AM   #3
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
Usually the cgi-bin will be one dir up from your public_html. If you put the page that calls the script in public_html,
it should reference to .. (one dir up so we are in domain_name) and down into dir /cgi-bin
So ../cgi-bin

also look at:
3.2.2. Absolute and relative paths
In relative paths we also use the . and .. indications for the current and
the parent directory. A couple of practical examples:
Hope that helps ...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: ln and relative paths tortle Programming 8 05-10-2010 05:50 AM
Absolute and relative paths Gins Linux - General 6 11-08-2008 08:48 PM
Symbolic Links, directories, and relative paths (../). Can it be done? jimwillsher Linux - Newbie 1 03-11-2005 05:27 PM
relative/absolute paths in Java djgerbavore Programming 2 10-26-2004 08:01 PM
program that generates relative paths? TheMaXX Linux - Software 1 10-21-2003 02:17 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration