systemd-cgls(1)
Recursively show the contents of Linux control group hierarchies and their resource limits.
Synopsis
systemd-cgls [OPTIONS] [CGROUP]Description
systemd-cgls recursively shows the contents of the specified Linux control group (cgroup) hierarchy in a tree format. If no cgroup is specified, it defaults to the root cgroup of the current cgroup v2 hierarchy. This tool is useful for monitoring which processes belong to which cgroups and understanding systemd's resource management organization.
The output displays the cgroup tree structure with process information, memory usage, and other resource-related details depending on the cgroup version and specified options. It integrates with systemd's unified cgroup management and displays both v1 and v2 cgroups.
Common options
| Flag | What it does |
|---|---|
-a, --all | Show all cgroups recursively, including empty ones |
-l, --full | Do not abbreviate cgroup or process names; show full paths |
-k, --kibibytes | Use binary (1024-byte) units instead of decimal (1000-byte) units |
-M, --machine=CONTAINER | Operate on a local container or machine instead of the local system |
-n, --lines=INTEGER | Limit output to the specified number of lines |
-o, --output=TABLE|JSON | Output the cgroup tree in the specified format (default: tree) |
-p, --pattern=PATTERN | Only show cgroups matching the specified pattern |
-u, --unit | Show cgroup information for systemd units |
-h, --help | Print help text and exit |
--version | Print version information and exit |
Examples
Show the entire cgroup hierarchy starting from the root, displaying all cgroups and processes
systemd-cglsDisplay only the cgroups and processes under the system.slice cgroup
systemd-cgls /system.sliceShow the user.slice cgroup with full (non-abbreviated) cgroup paths and process names
systemd-cgls -l /user.sliceRecursively list all cgroups including empty ones that have no processes
systemd-cgls --allShow the cgroup hierarchy for a specific systemd service and all processes within it
systemd-cgls /system.slice/nginx.serviceOutput the cgroup hierarchy in JSON format for parsing by scripts or tools
systemd-cgls -o jsonShow cgroups from a specific systemd machine/container instead of the local system
systemd-cgls --machine=mycontainer /Show all user slice cgroups matching the pattern, including empty ones
systemd-cgls -p 'user-*.slice' -a