[I “finished” LP3THW, and bought LMP3THW. I’ve played around with several resources before this, and have to congratulate and thank Zed on creating such an effective set of tools! … But, I must admit I rushed through some of the final exercises in the first book and got bogged down, so I’m in the middle of a (very helpful!) chapter by chapter review … I’m picking up a few things, some of them quite simple, that I missed the first time through … Hence this question:]
In the Command Line Crash course, in a number of places the characters “./” appear. What do they mean? I can’t find an explanation anywhere I’ve tried to look.
Thanks in advance for your attention to what I know is a simple thing (that has bothered me for a few weeks!).
In linux, and probably all of unix operating systems, in the command line this is typed before the name of a program to run it.The same thing applies in powershell. I just typed ls in the system32 directory and found xwizard.exe. I typed ./xwizard.exe and it started the Extensible wizard host process.
ok, sure, and thanks for responding … but (in W10 at least) everything seems to run fine without it?
Yes, it’s just another way to get a job done without leaving the command line.
As @casajake mentioned, Powershell emulates the concept from Linux / Unix environment. To go further deep, in Linux, when you want to execute (run) a program, you need to explicitly mention the path (location) of the file; as the same file name might be present in different folders. The symbolic representation of the current folder is a period (.), similarly two periods (..) means the parent directory. Hence the command
cd .. in Linux (or even Windows command line) when you want to navigate one folder level up. So, when you type
>python .\ex1.py , you are telling the system that you want to run the ex1.py program present in the current folder.
Regarding the question on why it works even without it, the answer lies in Windows using a (.) in its environment variable (you can think of it as a place that lists all the paths to be checked when a command is entered). That means, check all the global paths and also the current folder where the command is typed.
Hope it helps.
@Rathish sure does. Thank you! … and … hmmm, based on where it’s being run, these 2 keystrokes are irrelevant (as are ALL mine on this topic!). Thanks for indulging, but also enlightening me.