Linux File Descriptors (fd), dup, and dup2 — The Real Structure Connecting Execution and Redirection
In Linux, redirection and pipes are not syntax tricks but structural changes in file descriptor (fd) connections. This article explains how dup and dup2 rewire stdout, stderr, and pipes, and how the shell reconstructs I/O flow before execution at the system-call level.