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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-31-2003, 12:23 AM
|
#1
|
Member
Registered: Jul 2003
Location: Lancaster, Pa
Distribution: Red Hat 9.0
Posts: 46
Rep:
|
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.
|
|
|
07-31-2003, 01:31 AM
|
#2
|
Member
Registered: Feb 2002
Location: Mission Viejo, California, USA
Distribution: Gentoo
Posts: 707
Rep:
|
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.
|
|
|
07-31-2003, 01:57 AM
|
#3
|
LQ Guru
Registered: Mar 2003
Location: New Jersey
Distribution: Arch Linux
Posts: 1,445
Rep:
|
. = 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
|
|
|
07-31-2003, 02:02 AM
|
#4
|
LQ Newbie
Registered: Jul 2003
Location: Ontario, Canada
Distribution: SuSE 8.1
Posts: 8
Rep:
|
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.
|
|
|
07-31-2003, 02:21 AM
|
#5
|
Member
Registered: Apr 2003
Location: /home/BillyGoatStrut
Distribution: Ubuntu, Debian "Sarge", Mac OS X
Posts: 110
Rep:
|
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.)?
|
|
|
07-31-2003, 04:50 AM
|
#6
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Rep:
|
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 /".
|
|
|
07-31-2003, 06:48 AM
|
#7
|
Member
Registered: Jul 2003
Location: Lancaster, Pa
Distribution: Red Hat 9.0
Posts: 46
Original Poster
Rep:
|
Thanks a bunch, guys, that helps.
|
|
|
All times are GMT -5. The time now is 07:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|