What happens when you type gcc main.c?

GCC

gcc is the C compiler of choice for most UNIX. The program gcc itself is actually just a front end that executes various other programs corresponding to each stage in the compilation process.

.c

A C file is a source code file for a C or C++ program. And .c is the C file extension.

Steps of compilation

There are 4 steps:

gcc main.c

So when we type gcc main.c, we are compiling the main.c file and making an executable code.