LinuxCommandLibrary

cgget

read cgroup parameters

TLDR

Display all parameters for a cgroup

$ cgget -a [path/to/cgroup]
copy
Display a specific parameter for a cgroup
$ cgget -r [cpu.shares] [path/to/cgroup]
copy
Display multiple parameters
$ cgget -r [cpuset.cpus] -r [cpuset.mems] [path/to/cgroup]
copy
Display parameters for a specific controller
$ cgget -g [cpu]:[path/to/cgroup]
copy
Display values only without parameter names
$ cgget -v -r [memory.limit_in_bytes] [path/to/cgroup]
copy
Display without group headers
$ cgget -n -g [cpu] /
copy
Show current cgroups setup mode
$ cgget -m
copy

SYNOPSIS

cgget [-n] [-v] [-m] [-r name] [-g controller] [-a] path...
cgget [-n] [-v] [-m] [-r name] -g controller:path...

DESCRIPTION

cgget prints parameters of Linux control groups (cgroups). Cgroups are a kernel mechanism for organizing processes and managing resource allocation including CPU, memory, and I/O.
If no controller or variable is specified, values for all available parameters are displayed. The command supports both cgroup v1 (legacy) and v2 (unified) hierarchies.

PARAMETERS

-a, --all

Print variables for all controllers in the given cgroup
-g controller[:path]
Specify controller and optionally path to display
-r, --variable name
Display specific parameter (can be used multiple times)
-n
Do not print group name headers
-v, --values-only
Print only values without parameter names
-m
Display current cgroups setup mode (legacy, unified, or hybrid)

CAVEATS

The CGROUP_LOGLEVEL environment variable controls verbosity (DEBUG, INFO, WARNING, ERROR).
Requires appropriate permissions to read cgroup parameters. Some parameters may only be available with root access.

SEE ALSO

cgset(1), cgcreate(1), cgexec(1), cgroups(7)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community