{
    "content": [
        {
            "type": "text",
            "text": "# HWDB (info)\n\n## NAME\n\nhwdb - Hardware Database\n\n## DESCRIPTION\n\nThe hardware database is a key-value store for associating\nmodalias-like keys to udev-property-like values. It is used primarily\nby udev to add the relevant properties to matching devices, but it can\nalso be queried directly.\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION**\n- **HARDWARE DATABASE FILES**\n- **EXAMPLES**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "HWDB",
        "section": "",
        "mode": "info",
        "summary": "hwdb - Hardware Database",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "Example 1. General syntax of hwdb files",
            "# /lib/udev/hwdb.d/example.hwdb",
            "# Comments can be placed before any records. This is a good spot",
            "# to describe what that file is used for, what kind of properties",
            "# it defines, and the ordering convention.",
            "# A record with three matches and one property",
            "mouse:*:name:*Trackball*:*",
            "mouse:*:name:*trackball*:*",
            "mouse:*:name:*TrackBall*:*",
            "IDINPUTTRACKBALL=1",
            "# The rule above could be also be written in a form that",
            "# matches Tb, tb, TB, tB:",
            "mouse:*:name:*[tT]rack[bB]all*:*",
            "IDINPUTTRACKBALL=1",
            "# A record with a single match and five properties",
            "mouse:usb:v046dp4041:name:Logitech MX Master:*",
            "MOUSEDPI=1000@166",
            "MOUSEWHEELCLICKANGLE=15",
            "MOUSEWHEELCLICKANGLEHORIZONTAL=26",
            "MOUSEWHEELCLICKCOUNT=24",
            "MOUSEWHEELCLICKCOUNTHORIZONTAL=14",
            "Example 2. Overriding of properties",
            "# /lib/udev/hwdb.d/60-keyboard.hwdb",
            "evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn*:*",
            "KEYBOARDKEYa1=help",
            "KEYBOARDKEYa2=setup",
            "KEYBOARDKEYa3=battery",
            "# Match vendor name \"Acer\" and any product name starting with \"X123\"",
            "evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer:pnX123*:*",
            "KEYBOARDKEYa2=wlan",
            "# /etc/udev/hwdb.d/70-keyboard.hwdb",
            "# disable wlan key on all at keyboards",
            "evdev:atkbd:*",
            "KEYBOARDKEYa2=reserved",
            "PROPERTYWITHSPACES=some string",
            "If the hwdb consists of those two files, a keyboard with the lookup",
            "string \"evdev:atkbd:dmi:bvnAcer:bdXXXXX:bd08/05/2010:svnAcer:pnX123\"",
            "will match all three records, and end up with the following properties:",
            "KEYBOARDKEYa1=help",
            "KEYBOARDKEYa2=reserved",
            "KEYBOARDKEYa3=battery",
            "PROPERTYWITHSPACES=some string"
        ],
        "see_also": [
            {
                "name": "systemd-hwdb",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/systemd-hwdb/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "HARDWARE DATABASE FILES",
                "lines": 47,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 53,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "hwdb - Hardware Database\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The hardware database is a key-value store for associating\nmodalias-like keys to udev-property-like values. It is used primarily\nby udev to add the relevant properties to matching devices, but it can\nalso be queried directly.\n",
                "subsections": []
            },
            "HARDWARE DATABASE FILES": {
                "content": "The hwdb files are read from the files located in the system hwdb\ndirectory /lib/udev/hwdb.d and the local administration directory\n/etc/udev/hwdb.d. All hwdb files are collectively sorted and processed\nin lexical order, regardless of the directories in which they live.\nHowever, files with identical filenames replace each other. Files in\n/etc/ have the highest priority and take precedence over files with the\nsame name in /lib/. This can be used to override a system-supplied hwdb\nfile with a local file if needed; a symlink in /etc/ with the same name\nas a hwdb file in /lib/, pointing to /dev/null, disables that hwdb file\nentirely. hwdb files must have the extension .hwdb; other extensions\nare ignored.\n\nEach hwdb file contains data records consisting of matches and\nassociated key-value pairs. Every record in the hwdb starts with one or\nmore match strings, specifying a shell glob to compare the lookup\nstring against. Multiple match lines are specified in consecutive\nlines. Every match line is compared individually, and they are combined\nby OR. Every match line must start at the first character of the line.\n\nMatch patterns consist of literal characters, and shell-style\nwildcards:\n\no   Asterisk \"*\" matches any number of characters\n\no   Question mark \"?\"  matches a single character\n\no   Character list \"[chars]\" matches one of the characters chars listed\nbetween \"[\" and \"]\". A range may be specified as with a dash as\n\"[first-last]\". The match may be inverted with a caret \"[^...]\".\n\nThe match lines are followed by one or more key-value pair lines, which\nare recognized by a leading space character. The key name and value are\nseparated by \"=\". An empty line signifies the end of a record. Lines\nbeginning with \"#\" are ignored.\n\nIn case multiple records match a given lookup string, the key-value\npairs from all records are combined. If a key is specified multiple\ntimes, the value from the record with the highest priority is used\n(each key can have only a single value). The priority is higher when\nthe record is in a file that sorts later lexicographically, and in case\nof records in the same file, later records have higher priority.\n\nThe content of all hwdb files is read by systemd-hwdb(8) and compiled\nto a binary database located at /etc/udev/hwdb.bin, or alternatively\n/lib/udev/hwdb.bin if you want ship the compiled database in an\nimmutable image. During runtime, only the binary database is used.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "Example 1. General syntax of hwdb files\n\n# /lib/udev/hwdb.d/example.hwdb\n# Comments can be placed before any records. This is a good spot\n# to describe what that file is used for, what kind of properties\n# it defines, and the ordering convention.\n\n# A record with three matches and one property\nmouse:*:name:*Trackball*:*\nmouse:*:name:*trackball*:*\nmouse:*:name:*TrackBall*:*\nIDINPUTTRACKBALL=1\n\n# The rule above could be also be written in a form that\n# matches Tb, tb, TB, tB:\nmouse:*:name:*[tT]rack[bB]all*:*\nIDINPUTTRACKBALL=1\n\n# A record with a single match and five properties\nmouse:usb:v046dp4041:name:Logitech MX Master:*\nMOUSEDPI=1000@166\nMOUSEWHEELCLICKANGLE=15\nMOUSEWHEELCLICKANGLEHORIZONTAL=26\nMOUSEWHEELCLICKCOUNT=24\nMOUSEWHEELCLICKCOUNTHORIZONTAL=14\n\nExample 2. Overriding of properties\n\n# /lib/udev/hwdb.d/60-keyboard.hwdb\nevdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn*:*\nKEYBOARDKEYa1=help\nKEYBOARDKEYa2=setup\nKEYBOARDKEYa3=battery\n\n# Match vendor name \"Acer\" and any product name starting with \"X123\"\nevdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer:pnX123*:*\nKEYBOARDKEYa2=wlan\n\n# /etc/udev/hwdb.d/70-keyboard.hwdb\n# disable wlan key on all at keyboards\nevdev:atkbd:*\nKEYBOARDKEYa2=reserved\nPROPERTYWITHSPACES=some string\n\nIf the hwdb consists of those two files, a keyboard with the lookup\nstring \"evdev:atkbd:dmi:bvnAcer:bdXXXXX:bd08/05/2010:svnAcer:pnX123\"\nwill match all three records, and end up with the following properties:\n\nKEYBOARDKEYa1=help\nKEYBOARDKEYa2=reserved\nKEYBOARDKEYa3=battery\nPROPERTYWITHSPACES=some string\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "systemd-hwdb(8)\n\nsystemd 249                                                            HWDB(7)",
                "subsections": []
            }
        }
    }
}