Definition
"Everything is a file" is the unifying metaphor Unix uses to expose disparate system resources through a single interface. A regular document, a connected hard drive, a running process, the keyboard you are typing on, a pseudo-random number generator, and a network connection are all reachable through file-shaped names that respond to the same handful of system calls: open, read, write, close. The kernel hides the underlying mechanics of each resource behind a uniform abstraction so that the same shell tools, scripts, and programs work on all of them without modification.
The metaphor leaks in places — sockets and certain devices need ioctl calls beyond plain read and write — but the abstraction is consistent enough that most user-space tooling can pretend the leaks do not exist.
Why it matters
How it works
The kernel maintains a unified table of open file descriptors per process. When a program opens a regular document, a network socket, or a device node under /dev, it receives back an integer descriptor that points into this table. Subsequent read and write calls operate on the descriptor without caring what kind of resource sits behind it — the kernel dispatches to the right driver internally. This indirection is the abstraction layer that lets a tool like cat copy bytes from a serial port, a network stream, or a hard drive partition with identical code.
Specialised virtual filesystems extend the metaphor inward. The /proc directory presents each running process as a numbered directory whose entries — status, environ, fd, maps — are readable text files describing kernel-tracked state. The /sys directory exposes device and driver configuration as writable files. Configuring a USB device or reading CPU temperature becomes a matter of writing to or reading from the right path. The file metaphor is therefore not just a storage abstraction but the primary interface to the running kernel itself.