← 返回命令列表

Linux command

cgget 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Display all parameters for a cgroup

cgget -a [path/to/cgroup]

Display a specific parameter for a cgroup

cgget -r [cpu.shares] [path/to/cgroup]

Display multiple parameters

cgget -r [cpuset.cpus] -r [cpuset.mems] [path/to/cgroup]

Display parameters for a specific controller

cgget -g [cpu]:[path/to/cgroup]

Display values only without parameter names

cgget -v -r [memory.limit_in_bytes] [path/to/cgroup]

Display without group headers

cgget -n -g [cpu] /

Show current cgroups setup mode

cgget -m

说明

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.

参数

-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)
-b
Ignore default systemd delegated hierarchy path; construct paths relative to root hierarchy
-c
Display controllers and their versions (can combine with -m)
-h, --help
Display help and exit

FAQ

What is the cgget command used for?

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.

How do I run a basic cgget example?

Run `cgget -a [path/to/cgroup]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --all do in cgget?

Print variables for all controllers in the given cgroup