5 questions to test your understanding
When a shell executes `ls > output.txt`, which sequence of operations does the child process perform before running `ls`?
When the shell sets up a pipe for `ls | grep foo`, what does it actually create?
The kernel enforces that file descriptor 1 usually refers to the terminal (stdout), which is why programs can rely on writing to fd 1 to display output.
When a process is created via fork(), the child process inherits a copy of the parent's file descriptor table.
Why can `ls > output.txt` redirect ls's output to a file without any modification to the `ls` source code?