What is the difference between a program and a process?
A program is the passive file on disk; a process is a running instance of it, living in memory with its own PID and resources.
The distinction is like a recipe versus the act of cooking it. The program is just bytes sitting in a file, doing nothing. The moment the kernel loads it and gives it CPU time, it becomes a process — an active entity with state, memory, and an identity.
| Aspect | Program | Process |
|---|---|---|
| Where | Disk (an executable file) | RAM |
| State | Static, passive | Dynamic, active |
| Identity | Filename | PID (process ID) |
| Resources | None | CPU time, memory, open files |
A process is far more than just the code — the kernel wraps it in a whole context:
- the program code loaded into RAM
- a private memory address space (so processes can't clobber each other)
- a security context (owner UID, permissions) that decides what it may touch
- scheduling state and metadata (state, priority, parent)
- environment variables
- open file descriptors (stdin/stdout/stderr and any files/sockets)
Key insight: one program yields many independent processes — open three terminals and you have three bash processes, each with its own PID and memory, all from the one /bin/bash file. This is exactly why the same program can run for many users at once without interfering.