Forrest logo
back to the cgcreate tool

cgcreate:tldr:68219

cgcreate: Create a new group.
$ cgcreate -g ${group_type}:${group_name}
try on your machine

The command "cgcreate -g ${group_type}:${group_name}" is used to create a control group (cgroup) with a specified group type and name.

A control group is a feature in the Linux kernel that allows the system administrator to manage and allocate system resources such as CPU, memory, disk I/O, and network bandwidth to a group of processes. It helps in resource allocation and isolation by limiting resource usage for specific tasks or groups of tasks.

In the given command, the option "-g" is used to specify that we want to create a new control group. The "${group_type}" is a placeholder for the type of the control group. This can be one of the predefined cgroup types like "cpu", "memory", "blkio" (block I/O), "net_cls" (network class), etc. The "${group_name}" is also a placeholder for the name you want to assign to the control group.

For example, if you want to create a control group of type "cpu" with the name "mygroup", you would run the command as follows:

cgcreate -g cpu:mygroup

This will create a new control group named "mygroup" under the "cpu" cgroup type. Once created, you can use other commands like "cgset" and "cgexec" to modify or execute processes within this control group and manage their resource usage.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the cgcreate tool