prova.c is a source file. It's plain-text and contains your program's source code. Once you've compiled it, a new file will be created, probably
prova (with no extension). This is the executable – a binary file – which you can run from your terminal.
Many executables in your shell are available everywhere, without having to type the full path. For example,
sudo, is actually
/usr/bin/sudo, but your shell will know to search in
/usr/bin. However, your own programs are not automatically found by the shell. You'll have to tell it where it is.
If you don't want to write the full path, just change your working directory before:
Now you can call your program like this, where
. specifies the current directory. You'll have to include the
./ since your current directory normally is not in the list of paths where your shell searches for executable programs.
This might not work if the binary does not have execute rights set. This is a flag that allows the file to be run from a terminal. If you get a permission denied error, add the execute permission:
chmod +x prova
Now, try running the file again with