{
    "content": [
        {
            "type": "text",
            "text": "# hwdb(7) (man)\n\n**Summary:** hwdb - Hardware Database\n\n## Examples\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- `# A record with three matches and one property`\n- `mouse:*:name:*Trackball*:*`\n- `mouse:*:name:*trackball*:*`\n- `mouse:*:name:*TrackBall*:*`\n- `IDINPUTTRACKBALL=1`\n- `# The rule above could be also be written in a form that`\n- `# matches Tb, tb, TB, tB:`\n- `mouse:*:name:*[tT]rack[bB]all*:*`\n- `IDINPUTTRACKBALL=1`\n- `# A record with a single match and five properties`\n- `mouse:usb:v046dp4041:name:Logitech MX Master:*`\n- `MOUSEDPI=1000@166`\n- `MOUSEWHEELCLICKANGLE=15`\n- `MOUSEWHEELCLICKANGLEHORIZONTAL=26`\n- `MOUSEWHEELCLICKCOUNT=24`\n- `MOUSEWHEELCLICKCOUNTHORIZONTAL=14`\n- `# /lib/udev/hwdb.d/60-keyboard.hwdb`\n- `evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn*:*`\n- `KEYBOARDKEYa1=help`\n- `KEYBOARDKEYa2=setup`\n- `KEYBOARDKEYa3=battery`\n- `# Match vendor name \"Acer\" and any product name starting with \"X123\"`\n- `evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer:pnX123*:*`\n- `KEYBOARDKEYa2=wlan`\n- `# /etc/udev/hwdb.d/70-keyboard.hwdb`\n- `# disable wlan key on all at keyboards`\n- `evdev:atkbd:*`\n- `KEYBOARDKEYa2=reserved`\n- `PROPERTYWITHSPACES=some string`\n- `If the hwdb consists of those two files, a keyboard with the lookup string`\n- `\"evdev:atkbd:dmi:bvnAcer:bdXXXXX:bd08/05/2010:svnAcer:pnX123\" will match all three records,`\n- `and end up with the following properties:`\n- `KEYBOARDKEYa1=help`\n- `KEYBOARDKEYa2=reserved`\n- `KEYBOARDKEYa3=battery`\n- `PROPERTYWITHSPACES=some string`\n\n## See Also\n\n- systemd-hwdb(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (4 lines)\n- **HARDWARE DATABASE FILES** (39 lines)\n- **EXAMPLES** (1 lines) — 2 subsections\n  - Example 1. General syntax of hwdb files (24 lines)\n  - Example 2. Overriding of properties (25 lines)\n- **SEE ALSO** (5 lines)\n\n## Full Content\n\n### NAME\n\nhwdb - Hardware Database\n\n### DESCRIPTION\n\nThe hardware database is a key-value store for associating modalias-like keys to\nudev-property-like values. It is used primarily by udev to add the relevant properties to\nmatching devices, but it can also be queried directly.\n\n### HARDWARE DATABASE FILES\n\nThe hwdb files are read from the files located in the system hwdb directory /lib/udev/hwdb.d\nand the local administration directory /etc/udev/hwdb.d. All hwdb files are collectively\nsorted and processed in lexical order, regardless of the directories in which they live.\nHowever, files with identical filenames replace each other. Files in /etc/ have the highest\npriority and take precedence over files with the same name in /lib/. This can be used to\noverride a system-supplied hwdb file with a local file if needed; a symlink in /etc/ with the\nsame name as a hwdb file in /lib/, pointing to /dev/null, disables that hwdb file entirely.\nhwdb files must have the extension .hwdb; other extensions are ignored.\n\nEach hwdb file contains data records consisting of matches and associated key-value pairs.\nEvery record in the hwdb starts with one or more match strings, specifying a shell glob to\ncompare the lookup string against. Multiple match lines are specified in consecutive lines.\nEvery match line is compared individually, and they are combined by OR. Every match line must\nstart at the first character of the line.\n\nMatch patterns consist of literal characters, and shell-style wildcards:\n\n•   Asterisk \"*\" matches any number of characters\n\n•   Question mark \"?\"  matches a single character\n\n•   Character list \"[chars]\" matches one of the characters chars listed between \"[\" and \"]\".\nA range may be specified as with a dash as \"[first-last]\". The match may be inverted with\na caret \"[^...]\".\n\nThe match lines are followed by one or more key-value pair lines, which are recognized by a\nleading space character. The key name and value are separated by \"=\". An empty line signifies\nthe end of a record. Lines beginning with \"#\" are ignored.\n\nIn case multiple records match a given lookup string, the key-value pairs from all records\nare combined. If a key is specified multiple times, the value from the record with the\nhighest priority is used (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 of records in the\nsame file, later records have higher priority.\n\nThe content of all hwdb files is read by systemd-hwdb(8) and compiled to a binary database\nlocated at /etc/udev/hwdb.bin, or alternatively /lib/udev/hwdb.bin if you want ship the\ncompiled database in an immutable image. During runtime, only the binary database is used.\n\n### EXAMPLES\n\n#### 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\n#### Example 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 string\n\"evdev:atkbd:dmi:bvnAcer:bdXXXXX:bd08/05/2010:svnAcer:pnX123\" will match all three records,\nand end up with the following properties:\n\nKEYBOARDKEYa1=help\nKEYBOARDKEYa2=reserved\nKEYBOARDKEYa3=battery\nPROPERTYWITHSPACES=some string\n\n### SEE ALSO\n\nsystemd-hwdb(8)\n\n\n\nsystemd 249                                                                                  HWDB(7)\n\n"
        }
    ],
    "structuredContent": {
        "command": "hwdb",
        "section": "7",
        "mode": "man",
        "summary": "hwdb - Hardware Database",
        "synopsis": null,
        "flags": [],
        "examples": [
            "# /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",
            "# /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": 4,
                "subsections": []
            },
            {
                "name": "HARDWARE DATABASE FILES",
                "lines": 39,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Example 1. General syntax of hwdb files",
                        "lines": 24
                    },
                    {
                        "name": "Example 2. Overriding of properties",
                        "lines": 25
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}