sys_dev(5)
π
/sys/dev/ β system devices (from sys_dev(5), the file formats manual bestie)
β¨ NAME β¨
/sys/dev/ β it's the system devices directory, and it's literally the plug that tells you where every device lives π«Ά
πΈ SYNOPSIS πΈ
/sys/dev/
π DESCRIPTION π
Okay so picture this: /sys/dev/ has exactly two subdirectories inside it, and their names are block/ and char/. No cap. They line up with the block devices and the character devices on your system, respectively. Iconic behaviour honestly.
Inside each of those two subdirectories you'll find symbolic links, and their names are formatted like major-ID:minor-ID β where those ID values are the major and minor ID of one specific device. Every single one of those symlinks points at the sysfs directory for a device. π«
So what's the point? The symlinks in /sys/dev/ are your cheat code: they give you an easy way to look up the sysfs interface using the device IDs that come back from a call to stat(2) (or anything similar). It's giving lookup table. It's giving convenience. We love her. π
And here's a shell session showing an example straight out of /sys/dev/, verbatim, no edits:
$ stat -c "%t %T" /dev/null;
1 3
$ readlink /sys/dev/char/1\:3;
../../devices/virtual/mem/null
$ ls -Fd /sys/devices/virtual/mem/null;
/sys/devices/virtual/mem/null/
$ ls -d1 /sys/devices/virtual/mem/null/*;
/sys/devices/virtual/mem/null/dev
/sys/devices/virtual/mem/null/power/
/sys/devices/virtual/mem/null/subsystem@
/sys/devices/virtual/mem/null/uevent
See how 1 3 from stat turned into char/1:3 turned into the actual devices path? That's the whole trick and she ATE π₯
β STANDARDS β
Linux. That's the standard. Periodt.
π¦ HISTORY π¦
Linux 2.6.0. Been here since forever, lowkey a legend.
π SEE ALSO π
sysfs(5)β go read that one next bestie, they're besties fr fr
okay that's the whole page!! every last detail, not one crumb left behind π
This lil masterpiece lives in Linux man-pages 6.20, dated 2026-09-09 β so if you ever need to cite her, that's the glow-up era she came from. Stay slaying, and go readlink something π«Άβ¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2017, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms