I’ve heard and read that in UNIX-like systems that everything is a file. Here are some notes of what I found that describes the system in such a way.
The Linux Kernel describe pseudo-filesystems like sys and proc as files and directories.
sysfs
A filesystem for exporting kernel objects.
- Provides an interface to kernel data structures.
- Commonly mounted at
/sys - The files under
sysfsprovide information about devices, kernel modules, filesystems, and other kernel components. - Most files in
sysfsare read-only
proc
Process information, system information, and sysctl pseudo-filesystem
- Provides an interface to kernel data structures
- Commonly mounted at
/proc - Most files in
procare read-only
A lot of good information that you see in tools like htop are in there.