They're device nodes:
In Unix-like operating systems, a device file or special file is an
interface for a device driver that appears in a file system as if it
were an ordinary file. [...] They allow software to interact with a device
driver using standard input/output system calls, which simplifies many
tasks and unifies user-space I/O mechanisms.
In other words, they're not normal files, although they may be organized into regular directories. Historically, these were actual nodes created on disk that contained a smidge of information for the kernel. On contemporary linux systems, this has been replaced with a special in-memory filesystem, devtmpfs, much like /proc
is an in-memory procfs and /sys
an in-memory sysfs. That's why they are listed as having 0 bytes -- they are direct interfaces with kernel.
As to what they all are, there is a section about "Naming Conventions" in that wikipedia article, although this is not binding or universal (they may be renamed from userspace, which e.g., RedHat/Fedora derived udev installations will do). You can get another couple of clues from the major/minor number, shown in two columns left of the date with ls -l
(where "size" would be). Those numbers correspond to entries in /sys/dev/block
or /sys/dev/char
.
Keep in mind most of these devices are virtual and may have little or nothing to do with any particular part of the hardware. For example, tty
devices are the virtual terminals you can navigate with ctrl-alt-F[N]; pt
devices (there's a directory for them) are pseudo-terminals used in GUI emulators. There are various other more esoteric things such as shared memory segments (under shm
-- these have actual sizes). Again, the purpose is just to allow for a standardized interface to the kernel; the concept of "device" is very loose.