Let’s split this into parts:
-
$is a character indicating that the shell is ready to receive a command. It is not part of the command. -
gccis an executable executing the GNU C compiler from the GCC toolchain. -
test.c -o demoare arguments supplied togcc.
The GCC toolchain is only available natively for GNU systems such as Linux. Using MinGW or CygWin you can ape its functionality, though.
Notes:
-
A nice comment, which I second, to your question by @iharob:
Don’t use
gcc test.c -o demospecially if you are a beginner, usegcc -Wall -Wextra -Werror test.c -o demo.The additional switches make the compiler point out more warnings.
0
solved How to compile a simple C code with “$gcc test.c -o demo” command?