cgcreate is a command-line utility in Linux that is used to create and manage control groups (cgroups). Cgroups are a Linux kernel feature that allows you to limit, prioritize, and isolate the resource usage of processes and applications on the system.
If you encounter the below error while running the cgcreate command:
cgcreate: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install cgroup-tools |
Ubuntu | apt-get install cgroup-tools |
Kali Linux | apt-get install cgroup-tools |
CentOS | yum install libcgroup |
Fedora | dnf install libcgroup-tools |
Raspbian | apt-get install cgroup-tools |
Once you have created a cgroup using cgcreate, you can use other cgroup utilities, such as cgset and cgclassify, to configure and manage the cgroup.
For more information on using cgcreate and the other cgroup utilities, you can consult the cgroup documentation or use the cgcreate –help command to view a list of available options and usage examples.
cgcreate Command Examples
1. Create a new group:
# cgcreate -g group_type:group_name
2. Create a new group with multiple cgroup types:
# cgcreate -g group_type1,group_type2:group_name
3. Create a subgroup:
# mkdir /sys/fs/cgroup/group_type/group_name/subgroup_name