At this point, our hello.c source program has been translated by the compilation system into an executable object file called hello that is stored on disk. To run the executable file on a Unix system, we type its name to an application program known as a "shell":
unix> ./hello
hello, world
unix>
The shell is a program (command-line interpreter) that lets you type commands. It shows a prompt (like unix>
), waits for you to type something, and then runs the command you typed.
If the command you type isn't one of the shell’s built-in commands, the shell assumes it's the name of a program file that it should run.
In this case, if you type ./hello
, the shell will load and run the hello
program.
The hello
program will display its message on the screen and then stop.
After the program finishes, the shell will show a new prompt and wait for you to type another command.
So basically, the shell is your interface for running programs and executing commands on your system.