Why Do I Need to Use './' to Run Executables in Linux?

March 28, 2026 1 answer
Asked by CuriousCat22
I'm trying to run an executable file in my current directory on Linux, but I've noticed that I can't just type the name of the file, like 'myApp'. Instead, I have to use './myApp'. Why is that the case?

Answers

TechSavvy101
Linux doesn't automatically check your current directory for executables. When you just type 'myApp', the system doesn't recognize it because it's searching in a set of directories defined in the PATH variable instead. To run your application directly, you specify './' which tells the system you're talking about the program in the current directory. It's like saying, 'Hey, run this specific file here!'

Questioner123: Why doesn't Linux just look in the current directory automatically like some other systems?

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions