-4

I am working with this c++ project for making command line text editor like Vim. The documentation tells that in order to run this text editor in terminal you need to write command ./main in the project folder.

The project folder has main.cpp file. Is this a command to execute that file (may be I am wrong) or this command is a standard terminal command.

Thank you.

person
  • 123
  • 8
  • 1
    `./` indicates it is in this folder. `main` is the name of the executable (which a .cpp file is not), so `./main` executes an executable called `main` in the current folder. – R_Kapp Feb 15 '16 at 14:48
  • This is not a question about programming, I'm voting to close the question. – YSC Feb 15 '16 at 14:59
  • This is clearly **not** a duplicate of the linked question. – Galik Feb 15 '16 at 15:06

1 Answers1

1

Running ./main means run main from the current directory (.).

The current directory is normally missing from $PATH so you have to specify it explicitly.

trojanfoe
  • 120,358
  • 21
  • 212
  • 242
  • can you please tell what is $PATH. And why do we need to specify any path as I can execute from any location. ( Please bear with me as I am newbie in programming ). – person Feb 15 '16 at 14:52
  • 1
    Sorry but not knowing what `$PATH` is makes you a newbie as a user, not a programmer. – trojanfoe Feb 15 '16 at 14:53