Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a C program in Linux

Tags:

c

linux

Can someone explain to me why, in particular, we are using ./a.out to run a program?

Is there any meaning behind this?

Can someone please provide an explanation?

like image 819
Muthaiya Avatar asked Mar 19 '11 10:03

Muthaiya


1 Answers

The name stands for "assembler output", and was (and still is) the default name for the executable generated by the compiler. The reason you need ./ in front of it is because the current directory (.) is not in $PATH therefore the path to the executable must be explicitly given.

like image 106
Ignacio Vazquez-Abrams Avatar answered Oct 18 '22 08:10

Ignacio Vazquez-Abrams