{
    "content": [
        {
            "type": "text",
            "text": "# SYSFS(5) (man)\n\n**Summary:** sysfs - a filesystem for exporting kernel objects\n\n## See Also\n\n- proc(5)\n- udev(7)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (14 lines) — 1 subsections\n  - Files and directories (151 lines)\n- **VERSIONS** (2 lines)\n- **CONFORMING TO** (2 lines)\n- **NOTES** (3 lines)\n- **SEE ALSO** (7 lines)\n- **COLOPHON** (7 lines)\n\n## Full Content\n\n### NAME\n\nsysfs - a filesystem for exporting kernel objects\n\n### DESCRIPTION\n\nThe sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data struc‐\ntures.  (More precisely, the files and directories in sysfs provide a  view  of  the  kobject\nstructures  defined internally within the kernel.)  The files under sysfs provide information\nabout devices, kernel modules, filesystems, and other kernel components.\n\nThe sysfs filesystem is commonly mounted at /sys.  Typically, it is mounted automatically  by\nthe system, but it can also be mounted manually using a command such as:\n\nmount -t sysfs sysfs /sys\n\nMany  of the files in the sysfs filesystem are read-only, but some files are writable, allow‐\ning kernel variables to be changed.  To avoid redundancy, symbolic links are heavily used  to\nconnect entries across the filesystem tree.\n\n#### Files and directories\n\nThe following list describes some of the files and directories under the /sys hierarchy.\n\n/sys/block\nThis  subdirectory contains one symbolic link for each block device that has been dis‐\ncovered on the system.  The symbolic links point to  corresponding  directories  under\n/sys/devices.\n\n/sys/bus\nThis directory contains one subdirectory for each of the bus types in the kernel.  In‐\nside each of these directories are two subdirectories:\n\ndevices\nThis subdirectory contains symbolic links to entries in /sys/devices that  cor‐\nrespond to the devices discovered on this bus.\n\ndrivers\nThis  subdirectory  contains  one  subdirectory  for each device driver that is\nloaded on this bus.\n\n/sys/class\nThis subdirectory contains a single layer of further subdirectories for  each  of  the\ndevice  classes  that have been registered on the system (e.g., terminals, network de‐\nvices, block devices, graphics devices, sound devices, and so  on).   Inside  each  of\nthese  subdirectories are symbolic links for each of the devices in this class.  These\nsymbolic links refer to entries in the /sys/devices directory.\n\n/sys/class/net\nEach of the entries in this directory is a symbolic link representing one of the  real\nor virtual networking devices that are visible in the network namespace of the process\nthat is accessing the directory.  Each of these symbolic links refers  to  entries  in\nthe /sys/devices directory.\n\n/sys/dev\nThis  directory  contains  two subdirectories block/ and char/, corresponding, respec‐\ntively, to the block and character devices on the system.  Inside each of these subdi‐\nrectories  are  symbolic  links with names of the form major-ID:minor-ID, where the ID\nvalues correspond to the major and minor ID of a specific device.  Each symbolic  link\npoints  to  the sysfs directory for a device.  The symbolic links inside /sys/dev thus\nprovide an easy way to look up the sysfs interface using the device IDs returned by  a\ncall to stat(2) (or similar).\n\nThe following shell session shows an example from /sys/dev:\n\n$ stat -c \"%t %T\" /dev/null\n1 3\n$ readlink /sys/dev/char/1\\:3\n../../devices/virtual/mem/null\n$ ls -Fd /sys/devices/virtual/mem/null\n/sys/devices/virtual/mem/null/\n$ ls -d1 /sys/devices/virtual/mem/null/*\n/sys/devices/virtual/mem/null/dev\n/sys/devices/virtual/mem/null/power/\n/sys/devices/virtual/mem/null/subsystem@\n/sys/devices/virtual/mem/null/uevent\n\n/sys/devices\nThis  is  a  directory  that contains a filesystem representation of the kernel device\ntree, which is a hierarchy of device structures within the kernel.\n\n/sys/firmware\nThis subdirectory contains interfaces for viewing and  manipulating  firmware-specific\nobjects and attributes.\n\n/sys/fs\nThis directory contains subdirectories for some filesystems.  A filesystem will have a\nsubdirectory here only if it chose to explicitly create the subdirectory.\n\n/sys/fs/cgroup\nThis directory conventionally is used as a mount point for a tmpfs(5) filesystem  con‐\ntaining mount points for cgroups(7) filesystems.\n\n/sys/fs/smackfs\nThe  directory  contains configuration files for the SMACK LSM.  See the kernel source\nfile Documentation/admin-guide/LSM/Smack.rst.\n\n/sys/hypervisor\n[To be documented]\n\n/sys/kernel\nThis subdirectory contains various files and subdirectories that  provide  information\nabout the running kernel.\n\n/sys/kernel/cgroup/\nFor information about the files in this directory, see cgroups(7).\n\n/sys/kernel/debug/tracing\nMount point for the tracefs filesystem used by the kernel's ftrace facility.  (For in‐\nformation on ftrace, see the kernel source file Documentation/trace/ftrace.txt.)\n\n/sys/kernel/mm\nThis subdirectory contains various files and subdirectories that  provide  information\nabout the kernel's memory management subsystem.\n\n/sys/kernel/mm/hugepages\nThis  subdirectory  contains one subdirectory for each of the huge page sizes that the\nsystem  supports.   The  subdirectory  name  indicates  the  huge  page  size   (e.g.,\nhugepages-2048kB).   Within each of these subdirectories is a set of files that can be\nused to view and (in some cases) change settings associated with that huge page  size.\nFor   further   information,   see   the   kernel   source  file  Documentation/admin-\nguide/mm/hugetlbpage.rst.\n\n/sys/module\nThis subdirectory contains one subdirectory for each module that is  loaded  into  the\nkernel.   The name of each directory is the name of the module.  In each of the subdi‐\nrectories, there may be following files:\n\ncoresize\n[to be documented]\n\ninitsize\n[to be documented]\n\ninitstate\n[to be documented]\n\nrefcnt [to be documented]\n\nsrcversion\n[to be documented]\n\ntaint  [to be documented]\n\nuevent [to be documented]\n\nversion\n[to be documented]\n\nIn each of the subdirectories, there may be following subdirectories:\n\ndrivers\n[To be documented]\n\nholders\n[To be documented]\n\nnotes  [To be documented]\n\nparameters\nThis directory contains one file for each module parameter, with each file con‐\ntaining  the  value  of  the  corresponding parameter.  Some of these files are\nwritable, allowing the\n\nsections\nThis subdirectories contains files  with  information  about  module  sections.\nThis information is mainly used for debugging.\n\n[To be documented]\n\n/sys/power\n[To be documented]\n\n### VERSIONS\n\nThe sysfs filesystem first appeared in Linux 2.6.0.\n\n### CONFORMING TO\n\nThe sysfs filesystem is Linux-specific.\n\n### NOTES\n\nThis  manual  page is incomplete, possibly inaccurate, and is the kind of thing that needs to\nbe updated very often.\n\n### SEE ALSO\n\nproc(5), udev(7)\n\nP. Mochel. (2005).  The sysfs filesystem.  Proceedings of the 2005 Ottawa Linux Symposium.\n\nThe kernel source file Documentation/filesystems/sysfs.txt and various other files  in  Docu‐\nmentation/ABI and Documentation/*/sysfs.txt\n\n### COLOPHON\n\nThis  page  is  part  of  release  5.10 of the Linux man-pages project.  A description of the\nproject, information about reporting bugs, and the latest version of this page, can be  found\nat https://www.kernel.org/doc/man-pages/.\n\n\n\nLinux                                        2018-04-30                                     SYSFS(5)\n\n"
        }
    ],
    "structuredContent": {
        "command": "SYSFS",
        "section": "5",
        "mode": "man",
        "summary": "sysfs - a filesystem for exporting kernel objects",
        "synopsis": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "proc",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/proc/5/json"
            },
            {
                "name": "udev",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/udev/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 14,
                "subsections": [
                    {
                        "name": "Files and directories",
                        "lines": 151
                    }
                ]
            },
            {
                "name": "VERSIONS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CONFORMING TO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "COLOPHON",
                "lines": 7,
                "subsections": []
            }
        ]
    }
}