Linux - NewbieThis 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.
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.
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).
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.
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.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,619
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 /".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.