LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-31-2003, 12:23 AM   #1
teyesahr
Member
 
Registered: Jul 2003
Location: Lancaster, Pa
Distribution: Red Hat 9.0
Posts: 46

Rep: Reputation: 15
Seaking a broader understanding


What does ./ mean, specifically when it's ./configure in full form? (I just installed the macromedia flash player, and they had ./install-flash..., so now I'm curious).

Thanks for any info.
 
Old 07-31-2003, 01:31 AM   #2
zmedico
Member
 
Registered: Feb 2002
Location: Mission Viejo, California, USA
Distribution: Gentoo
Posts: 707

Rep: Reputation: 30
The shell will not execute files in the current directory without the ./ prefix, otherwise it searches through the directories listed in the PATH environment variable.
 
Old 07-31-2003, 01:57 AM   #3
contrasutra
LQ Guru
 
Registered: Mar 2003
Location: New Jersey
Distribution: Arch Linux
Posts: 1,445

Rep: Reputation: 47
. = current directory

.. = previous directory.

So say you had a file in /bin called "program".

you could do:

/bin/program -- to execute it.

But say you were already in the /bin directory. You can do

./program
 
Old 07-31-2003, 02:02 AM   #4
storm3x
LQ Newbie
 
Registered: Jul 2003
Location: Ontario, Canada
Distribution: SuSE 8.1
Posts: 8

Rep: Reputation: 1
Let me give this one a try.

First some background:

1. The single dot is a shorthand for the name of the current directory that you're in. Think of it as a stand-in for the name of the directory you're in without the trailing slash. (Type "pwd" at the command prompt to print your current "working" directory).

2. The system maintains a list of directories where it will search for executable files such as programs, like "gimp" for example, or for scripts like "configure". To see where the system will look, type "echo $PATH" at the command prompt.

3. If more than one copy of a program or script exists within these directories, then the first one encountered in the list will be the one that is executed. For example, "configure" scripts are found in many locations. The one that gets run may not be the one that you had intended.

4. Unlike DOS, Linux does not automatically look into your current directory for an executable unless a dot "." happens to be in your PATH. For security reasons some people think it's a bad idea to add the current directory to a PATH statement. (This is beyond me. I read it in a book).

So to answer your question, placing "./" in front of a program or script name is simply a safeguard to ensure that the program that you end up running is the one that you're probably looking at right now in your current directory and not some similarly named program residing in a directory somewhere upstream in your PATH.
 
Old 07-31-2003, 02:21 AM   #5
DigitalTygrrr
Member
 
Registered: Apr 2003
Location: /home/BillyGoatStrut
Distribution: Ubuntu, Debian "Sarge", Mac OS X
Posts: 110

Rep: Reputation: 15
Thanks, storm3x, that's a very good explanation.

@ contrasutra - is it safe to assume if '..' is previous directory, then '...' is the directory before that and '....' (etc.)?
 
Old 07-31-2003, 04:50 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637

Rep: Reputation: Disabled
Quote:
Originally posted by DigitalTygrrr
... - is it safe to assume if '..' is previous directory, then '...' is the directory before that and '....' (etc.)?
No, it is not. "." and ".." work just like in DOS and more dots won't work. If you want to go right at the top of the directory tree type "cd /".
 
Old 07-31-2003, 06:48 AM   #7
teyesahr
Member
 
Registered: Jul 2003
Location: Lancaster, Pa
Distribution: Red Hat 9.0
Posts: 46

Original Poster
Rep: Reputation: 15
Thanks a bunch, guys, that helps.
 
  


Reply


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
help understanding ln dr_zayus69 Linux - General 3 01-14-2005 09:33 PM
A better understanding! nny0000 Slackware 1 04-14-2004 01:01 PM
Understanding X?? ++ bdp Linux - General 2 02-25-2004 06:47 PM
Understanding X?? nny0000 Linux - General 2 02-25-2004 03:07 AM
Understanding df -k itsjustme Linux - General 6 10-28-2003 01:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:07 AM.

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