{
    "mode": "man",
    "parameter": "systemd.syntax",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/systemd.syntax/7/json",
    "generated": "2026-06-03T06:53:13Z",
    "sections": {
        "NAME": {
            "content": "systemd.syntax - General syntax of systemd configuration files\n",
            "subsections": []
        },
        "INTRODUCTION": {
            "content": "This page describes the basic principles of configuration files used by systemd(1) and\nrelated programs for:\n\n•   systemd unit files, see systemd.unit(5), systemd.service(5), systemd.socket(5),\nsystemd.device(5), systemd.mount(5), systemd.automount(5), systemd.swap(5),\nsystemd.target(5), systemd.path(5), systemd.timer(5), systemd.slice(5), systemd.scope(5),\nsystemd.nspawn(5)\n\n•   link files, see systemd.link(5)\n\n•   netdev and network files, see systemd.netdev(5), systemd.network(5)\n\n•   daemon config files, see systemd-system.conf(5), systemd-user.conf(5), logind.conf(5),\njournald.conf(5), journal-remote.conf(5), journal-upload.conf(5), systemd-sleep.conf(5),\ntimesyncd.conf(5)\n\nThe syntax is inspired by XDG Desktop Entry Specification[1] .desktop files, which are in\nturn inspired by Microsoft Windows .ini files.\n\nEach file is a plain text file divided into sections, with configuration entries in the style\nkey=value. Whitespace immediately before or after the \"=\" is ignored. Empty lines and lines\nstarting with \"#\" or \";\" are ignored, which may be used for commenting.\n\nLines ending in a backslash are concatenated with the following line while reading and the\nbackslash is replaced by a space character. This may be used to wrap long lines. The limit on\nline length is very large (currently 1 MB), but it is recommended to avoid such long lines\nand use multiple directives, variable substitution, or other mechanism as appropriate for the\ngiven file type. When a comment line or lines follow a line ending with a backslash, the\ncomment block is ignored, so the continued line is concatenated with whatever follows the\ncomment block.\n",
            "subsections": [
                {
                    "name": "Example 1.",
                    "content": "[Section A]\nKeyOne=value 1\nKeyTwo=value 2\n\n# a comment\n\n[Section B]\nSetting=\"something\" \"some thing\" \"...\"\nKeyTwo=value 2 \\\nvalue 2 continued\n\n[Section C]\nKeyThree=value 3\\\n# this line is ignored\n; this line is ignored too\nvalue 3 continued\n\nBoolean arguments used in configuration files can be written in various formats. For positive\nsettings the strings 1, yes, true and on are equivalent. For negative settings, the strings\n0, no, false and off are equivalent.\n\nTime span values encoded in configuration files can be written in various formats. A\nstand-alone number specifies a time in seconds. If suffixed with a time unit, the unit is\nhonored. A concatenation of multiple values with units is supported, in which case the values\nare added up. Example: \"50\" refers to 50 seconds; \"2min 200ms\" refers to 2 minutes and 200\nmilliseconds, i.e. 120200 ms. The following time units are understood: \"s\", \"min\", \"h\", \"d\",\n\"w\", \"ms\", \"us\". For details see systemd.time(7).\n\nVarious settings are allowed to be specified more than once, in which case the interpretation\ndepends on the setting. Often, multiple settings form a list, and setting to an empty value\n\"resets\", which means that previous assignments are ignored. When this is allowed, it is\nmentioned in the description of the setting. Note that using multiple assignments to the same\nvalue makes the file incompatible with parsers for the XDG .desktop file format.\n"
                }
            ]
        },
        "QUOTING": {
            "content": "For settings where quoting is allowed, the following general rules apply: double quotes\n(\"...\") and single quotes ('...') may be used to wrap a whole item (the opening quote may\nappear only at the beginning or after whitespace that is not quoted, and the closing quote\nmust be followed by whitespace or the end of line), in which case everything until the next\nmatching quote becomes part of the same item. Quotes themselves are removed. C-style escapes\nare supported. The table below contains the list of known escape patterns. Only escape\npatterns which match the syntax in the table are allowed; other patterns may be added in the\nfuture and unknown patterns will result in a warning. In particular, any backslashes should\nbe doubled. Finally, a trailing backslash (\"\\\") may be used to merge lines, as described\nabove. UTF-8 is accepted, and hence typical unicode characters do not need to be escaped.\n",
            "subsections": [
                {
                    "name": "Table 1. Supported escapes",
                    "content": "┌─────────────┬────────────────────────────────┐\n│Literal      │ Actual value                   │\n├─────────────┼────────────────────────────────┤\n│\"\\a\"         │ bell                           │\n├─────────────┼────────────────────────────────┤\n│\"\\b\"         │ backspace                      │\n├─────────────┼────────────────────────────────┤\n│\"\\f\"         │ form feed                      │\n├─────────────┼────────────────────────────────┤\n│\"\\n\"         │ newline                        │\n├─────────────┼────────────────────────────────┤\n│\"\\r\"         │ carriage return                │\n├─────────────┼────────────────────────────────┤\n│\"\\t\"         │ tab                            │\n├─────────────┼────────────────────────────────┤\n│\"\\v\"         │ vertical tab                   │\n├─────────────┼────────────────────────────────┤\n│\"\\\\\"         │ backslash                      │\n├─────────────┼────────────────────────────────┤\n│\"\\\"\"         │ double quotation mark          │\n├─────────────┼────────────────────────────────┤\n│\"\\'\"         │ single quotation mark          │\n├─────────────┼────────────────────────────────┤\n│\"\\s\"         │ space                          │\n├─────────────┼────────────────────────────────┤\n│\"\\xxx\"       │ character number xx in         │\n│             │ hexadecimal encoding           │\n├─────────────┼────────────────────────────────┤\n│\"\\nnn\"       │ character number nnn in octal  │\n│             │ encoding                       │\n├─────────────┼────────────────────────────────┤\n│\"\\unnnn\"     │ unicode code point nnnn in     │\n│             │ hexadecimal encoding           │\n├─────────────┼────────────────────────────────┤\n│\"\\Unnnnnnnn\" │ unicode code point nnnnnnnn in │\n│             │ hexadecimal encoding           │\n└─────────────┴────────────────────────────────┘\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "systemd.time(7)\n",
            "subsections": []
        },
        "NOTES": {
            "content": "1. XDG Desktop Entry Specification\nhttp://standards.freedesktop.org/desktop-entry-spec/latest/\n\n\n\nsystemd 249                                                                        SYSTEMD.SYNTAX(7)",
            "subsections": []
        }
    },
    "summary": "systemd.syntax - General syntax of systemd configuration files",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "systemd.time",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/systemd.time/7/json"
        }
    ]
}