Stencel AcademyHow Linux Works →
Part 2 · Lesson 7 · Intermediate

fork() & exec()

See one program become two, then something else.

In this interactive Linux lesson from Stencel Academy you don't just read — you type real commands like ls and watch the machine respond on a live, animated map. It is part of the free How Linux Works course.

Key takeaway: Running a command = the shell forks, the copy exec's the program, the shell reaps it.

Before this lesson

Builds on: The Process Tree.

What you'll practise

Terms you'll learn

forkexecwaitzombiePID

Check your understanding

After the forked child exec's `ls` and `ls` finishes, what happens?
Open the interactive lesson →