bash. Usage of: './'

bash

Solution

After all, I am in the correct directory

But that directory isn't in the `PATH`. The gist of the matter is that when the shell wants to execute something it looks into a list of directories (specified in a variable called `PATH`). And the current directory isn't in that list.

Problem

I did try to find the answer online but unfortunately came up empty handed. Searching for './' in combination with other keywords brings up many hits, but none that helped... Anyhow, as you can probably tell, I am rather new to MacOs. I am running mongo from the shell. I cd into the /bin folder and start the mongo daemon with: './mongod' . If I just enter 'mongod', I get the following error: '-bash: mongod: command not found' What does the './' in './mongod' stand for? Why is it needed? Why can't I just execute mongo by typing mongod. After all, I am in the correct directory.

Original source

Related problems