A program is a set of instructions; a process is a running instance with execution state and resources such as open files. Starting a program twice can produce two processes. The operating system schedules processes, and each is identified by a process ID (PID) while it exists.
When you enter a command, the shell interprets it. Some commands are builtins implemented by the shell itself. For example, cd changes the shell’s current directory; an independent child process could not change its parent’s directory. Other commands are executable files that the shell starts as separate programs. Shell functions and aliases add other possibilities; exact resolution depends on the shell.
command -v cd
command -v sh
The first typically identifies the builtin by name; the second commonly reports a path. Output depends on the shell and machine. /bin/sh is a shell interface on Linux, often provided by a modern implementation rather than the original Bourne shell. Bash and Zsh add features; a script using one shell’s extensions may not work under another.
A compiler can translate source code to machine code ahead of time. An interpreter is a program that reads or otherwise executes instructions, such as a shell reading a shell script. Implementations can combine compilation, bytecode, and interpretation; a language is not invariably one or the other. An executable file can contain machine code or a script. Do not print unknown binary files into a terminal to inspect them.
source -> compiler -> executable -> running process
script -> interpreter ------------> running process
These arrows describe common routes, not every implementation. The next lesson follows a short script through both explicit and direct execution.