{
    "mode": "man",
    "parameter": "systemd-cgtop",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/systemd-cgtop/1/json",
    "generated": "2026-06-12T15:13:02Z",
    "synopsis": "systemd-cgtop [OPTIONS...] [GROUP]",
    "sections": {
        "NAME": {
            "content": "systemd-cgtop - Show top control groups by their resource usage\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "systemd-cgtop [OPTIONS...] [GROUP]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "systemd-cgtop shows the top control groups of the local Linux control group hierarchy,\nordered by their CPU, memory, or disk I/O load. The display is refreshed in regular intervals\n(by default every 1s), similar in style to top(1). If a control group path is specified,\nshows only the services of the specified control group.\n\nIf systemd-cgtop is not connected to a tty, no column headers are printed and the default is\nto only run one iteration. The --iterations= argument, if given, is honored. This mode is\nsuitable for scripting.\n\nResource usage is only accounted for control groups in the relevant hierarchy, i.e. CPU usage\nis only accounted for control groups in the \"cpuacct\" hierarchy, memory usage only for those\nin \"memory\" and disk I/O usage for those in \"blkio\". If resource monitoring for these\nresources is required, it is recommended to add the CPUAccounting=1, MemoryAccounting=1 and\nBlockIOAccounting=1 settings in the unit files in question. See systemd.resource-control(5)\nfor details.\n\nThe CPU load value can be between 0 and 100 times the number of processors the system has.\nFor example, if the system has 8 processors, the CPU load value is going to be between 0% and\n800%. The number of processors can be found in \"/proc/cpuinfo\".\n\nTo emphasize this: unless \"CPUAccounting=1\", \"MemoryAccounting=1\" and \"BlockIOAccounting=1\"\nare enabled for the services in question, no resource accounting will be available for system\nservices and the data shown by systemd-cgtop will be incomplete.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The following options are understood:\n",
            "subsections": [
                {
                    "name": "-p --order=path",
                    "content": "Order by control group path name.\n",
                    "flag": "-p",
                    "long": "--order",
                    "arg": "path"
                },
                {
                    "name": "-t --order=tasks",
                    "content": "Order by number of tasks/processes in the control group.\n",
                    "flag": "-t",
                    "long": "--order",
                    "arg": "tasks"
                },
                {
                    "name": "-c --order=cpu",
                    "content": "Order by CPU load.\n",
                    "flag": "-c",
                    "long": "--order",
                    "arg": "cpu"
                },
                {
                    "name": "-m --order=memory",
                    "content": "Order by memory usage.\n",
                    "flag": "-m",
                    "long": "--order",
                    "arg": "memory"
                },
                {
                    "name": "-i --order=io",
                    "content": "Order by disk I/O load.\n",
                    "flag": "-i",
                    "long": "--order",
                    "arg": "io"
                },
                {
                    "name": "-b --batch",
                    "content": "Run in \"batch\" mode: do not accept input and run until the iteration limit set with\n--iterations= is exhausted or until killed. This mode could be useful for sending output\nfrom systemd-cgtop to other programs or to a file.\n",
                    "flag": "-b",
                    "long": "--batch"
                },
                {
                    "name": "-r --raw",
                    "content": "Format byte counts (as in memory usage and I/O metrics) and CPU time with raw numeric\nvalues rather than human-readable numbers.\n\n--cpu=percentage, --cpu=time\nControls whether the CPU usage is shown as percentage or time. By default, the CPU usage\nis shown as percentage. This setting may also be toggled at runtime by pressing the %\nkey.\n",
                    "flag": "-r",
                    "long": "--raw"
                },
                {
                    "name": "-P",
                    "content": "Count only userspace processes instead of all tasks. By default, all tasks are counted:\neach kernel thread and each userspace thread individually. With this setting, kernel\nthreads are excluded from the counting and each userspace process only counts as one,\nregardless how many threads it consists of. This setting may also be toggled at runtime\nby pressing the P key. This option may not be combined with -k.\n",
                    "flag": "-P"
                },
                {
                    "name": "-k",
                    "content": "Count only userspace processes and kernel threads instead of all tasks. By default, all\ntasks are counted: each kernel thread and each userspace thread individually. With this\nsetting, kernel threads are included in the counting and each userspace process only\ncounts as on one, regardless how many threads it consists of. This setting may also be\ntoggled at runtime by pressing the k key. This option may not be combined with -P.\n",
                    "flag": "-k"
                },
                {
                    "name": "--recursive=",
                    "content": "Controls whether the number of processes shown for a control group shall include all\nprocesses that are contained in any of the child control groups as well. Takes a boolean\nargument, which defaults to \"yes\". If enabled, the processes in child control groups are\nincluded, if disabled, only the processes in the control group itself are counted. This\nsetting may also be toggled at runtime by pressing the r key. Note that this setting only\napplies to process counting, i.e. when the -P or -k options are used. It has not effect\nif all tasks are counted, in which case the counting is always recursive.\n"
                },
                {
                    "name": "-n --iterations=",
                    "content": "Perform only this many iterations. A value of 0 indicates that the program should run\nindefinitely.\n",
                    "flag": "-n"
                },
                {
                    "name": "-1",
                    "content": "A shortcut for --iterations=1.\n",
                    "flag": "-1"
                },
                {
                    "name": "-d --delay=",
                    "content": "Specify refresh delay in seconds (or if one of \"ms\", \"us\", \"min\" is specified as unit in\nthis time unit). This setting may also be increased and decreased at runtime by pressing\nthe + and - keys.\n",
                    "flag": "-d"
                },
                {
                    "name": "--depth=",
                    "content": "Maximum control group tree traversal depth. Specifies how deep systemd-cgtop shall\ntraverse the control group hierarchies. If 0 is specified, only the root group is\nmonitored. For 1, only the first level of control groups is monitored, and so on.\nDefaults to 3.\n"
                },
                {
                    "name": "-M --machine=",
                    "content": "Limit control groups shown to the part corresponding to the container MACHINE. This\noption may not be used when a control group path is specified.\n",
                    "flag": "-M"
                },
                {
                    "name": "-h --help",
                    "content": "Print a short help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "--version",
                    "content": "Print a short version string and exit.\n",
                    "long": "--version"
                }
            ]
        },
        "KEYS": {
            "content": "systemd-cgtop is an interactive tool and may be controlled via user input using the following\nkeys:\n\nh\nShows a short help text.\n\nSpace\nImmediately refresh output.\n\nq\nTerminate the program.\n\np, t, c, m, i\nSort the control groups by path, number of tasks, CPU load, memory usage, or I/O load,\nrespectively. This setting may also be controlled using the --order= command line switch.\n\n%\nToggle between showing CPU time as time or percentage. This setting may also be\ncontrolled using the --cpu= command line switch.\n\n+, -\nIncrease or decrease refresh delay, respectively. This setting may also be controlled\nusing the --delay= command line switch.\n\nP\nToggle between counting all tasks, or only userspace processes. This setting may also be\ncontrolled using the -P command line switch (see above).\n\nk\nToggle between counting all tasks, or only userspace processes and kernel threads. This\nsetting may also be controlled using the -k command line switch (see above).\n\nr\nToggle between recursively including or excluding processes in child control groups in\ncontrol group process counts. This setting may also be controlled using the --recursive=\ncommand line switch. This key is not available if all tasks are counted, it is only\navailable if processes are counted, as enabled with the P or k keys.\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "On success, 0 is returned, a non-zero failure code otherwise.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "systemd(1), systemctl(1), systemd-cgls(1), systemd.resource-control(5), top(1)\n\n\n\nsystemd 249                                                                         SYSTEMD-CGTOP(1)",
            "subsections": []
        }
    },
    "summary": "systemd-cgtop - Show top control groups by their resource usage",
    "flags": [
        {
            "flag": "-p",
            "long": "--order",
            "arg": "path",
            "description": "Order by control group path name."
        },
        {
            "flag": "-t",
            "long": "--order",
            "arg": "tasks",
            "description": "Order by number of tasks/processes in the control group."
        },
        {
            "flag": "-c",
            "long": "--order",
            "arg": "cpu",
            "description": "Order by CPU load."
        },
        {
            "flag": "-m",
            "long": "--order",
            "arg": "memory",
            "description": "Order by memory usage."
        },
        {
            "flag": "-i",
            "long": "--order",
            "arg": "io",
            "description": "Order by disk I/O load."
        },
        {
            "flag": "-b",
            "long": "--batch",
            "arg": null,
            "description": "Run in \"batch\" mode: do not accept input and run until the iteration limit set with --iterations= is exhausted or until killed. This mode could be useful for sending output from systemd-cgtop to other programs or to a file."
        },
        {
            "flag": "-r",
            "long": "--raw",
            "arg": null,
            "description": "Format byte counts (as in memory usage and I/O metrics) and CPU time with raw numeric values rather than human-readable numbers. --cpu=percentage, --cpu=time Controls whether the CPU usage is shown as percentage or time. By default, the CPU usage is shown as percentage. This setting may also be toggled at runtime by pressing the % key."
        },
        {
            "flag": "-P",
            "long": null,
            "arg": null,
            "description": "Count only userspace processes instead of all tasks. By default, all tasks are counted: each kernel thread and each userspace thread individually. With this setting, kernel threads are excluded from the counting and each userspace process only counts as one, regardless how many threads it consists of. This setting may also be toggled at runtime by pressing the P key. This option may not be combined with -k."
        },
        {
            "flag": "-k",
            "long": null,
            "arg": null,
            "description": "Count only userspace processes and kernel threads instead of all tasks. By default, all tasks are counted: each kernel thread and each userspace thread individually. With this setting, kernel threads are included in the counting and each userspace process only counts as on one, regardless how many threads it consists of. This setting may also be toggled at runtime by pressing the k key. This option may not be combined with -P."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Controls whether the number of processes shown for a control group shall include all processes that are contained in any of the child control groups as well. Takes a boolean argument, which defaults to \"yes\". If enabled, the processes in child control groups are included, if disabled, only the processes in the control group itself are counted. This setting may also be toggled at runtime by pressing the r key. Note that this setting only applies to process counting, i.e. when the -P or -k options are used. It has not effect if all tasks are counted, in which case the counting is always recursive."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "Perform only this many iterations. A value of 0 indicates that the program should run indefinitely."
        },
        {
            "flag": "-1",
            "long": null,
            "arg": null,
            "description": "A shortcut for --iterations=1."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "Specify refresh delay in seconds (or if one of \"ms\", \"us\", \"min\" is specified as unit in this time unit). This setting may also be increased and decreased at runtime by pressing the + and - keys."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Maximum control group tree traversal depth. Specifies how deep systemd-cgtop shall traverse the control group hierarchies. If 0 is specified, only the root group is monitored. For 1, only the first level of control groups is monitored, and so on. Defaults to 3."
        },
        {
            "flag": "-M",
            "long": null,
            "arg": null,
            "description": "Limit control groups shown to the part corresponding to the container MACHINE. This option may not be used when a control group path is specified."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Print a short help text and exit."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Print a short version string and exit."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "systemd",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
        },
        {
            "name": "systemctl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemctl/1/json"
        },
        {
            "name": "systemd-cgls",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemd-cgls/1/json"
        },
        {
            "name": "systemd.resource-control",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/systemd.resource-control/5/json"
        },
        {
            "name": "top",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/top/1/json"
        },
        {
            "name": "SYSTEMD-CGTOP",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/SYSTEMD-CGTOP/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Show the top control groups of the local Linux control group hierarchy, ordered by their CPU, memory, or disk I/O load.",
        "examples": [
            {
                "description": "Start an interactive view",
                "command": "systemd-cgtop"
            },
            {
                "description": "Change the sort order",
                "command": "systemd-cgtop --order {{cpu|memory|path|tasks|io}}"
            },
            {
                "description": "Show the CPU usage by time instead of percentage",
                "command": "systemd-cgtop --cpu=percentage"
            },
            {
                "description": "Change the update interval in seconds (or one of these time units: `ms`, `us`, `min`)",
                "command": "systemd-cgtop {{-d|--delay}} {{interval}}"
            },
            {
                "description": "Only count userspace processes (without kernel threads)",
                "command": "systemd-cgtop -P"
            }
        ]
    }
}