This is the third and final file-related chapter. In it, we reveal one of the kernel’s deepest, darkest secrets.
We’ve already looked at a few file-related commands, gone over how files—in general—are organized on your system, and learned how find a file when we need it.
You’re ready for the big secret, so here it is: through the eyes of the Linux kernel, everything is a file.
Devices like modems, monitors, CD-ROMS, hard drives, even keyboards and printers are files. You (what you type on the keyboard, at least) are a file, the data that appears on your screen in response to what you’ve typed is a file, even any error messages that might result from what you’ve typed is a file.
In fact, those last three files form something ...