LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

cgdelete

remove control groups

TLDR

Delete a cgroup
$ cgdelete -g [cpu]:[/mygroup]
copy
Delete a cgroup from multiple controllers
$ cgdelete -g [cpu,memory]:[/mygroup]
copy
Delete a cgroup recursively (including children)
$ cgdelete -r -g [cpu]:[/mygroup]
copy
Delete cgroup and all empty parents
$ cgdelete -g [memory]:[/parent/child]
copy

SYNOPSIS

cgdelete [-r] [-g controllers:path]...

DESCRIPTION

cgdelete removes cgroups from the Linux control group hierarchy. Cgroups (control groups) are used to limit, account for, and isolate resource usage of processes.The command removes the specified cgroup directory from the cgroup filesystem. By default, the cgroup must be empty (no processes or child cgroups) before deletion. The -r flag allows recursive deletion of child cgroups.cgdelete is part of libcgroup-tools, which provides user-space utilities for managing cgroups v1. Note that cgroups v2 uses a unified hierarchy and different management approaches.

PARAMETERS

-g controllers:path

Specify controller(s) and cgroup path to delete.
-r
Recursively delete child cgroups.
-h, --help
Display help information.

INSTALL

sudo apt install cgroup-tools
copy
sudo apk add cgroup-tools
copy

CAVEATS

Cannot delete cgroups that contain running processes. Requires appropriate permissions (typically root). The specified controllers must be mounted. Does not work with cgroups v2 unified hierarchy (use direct filesystem operations or systemd instead). Empty parent cgroups may be automatically removed.

HISTORY

cgdelete is part of libcgroup, a library and tools for managing Linux cgroups. The project was started by Red Hat around 2008 to provide user-space utilities for cgroups v1. As Linux moved toward cgroups v2, systemd became the primary cgroup manager on most systems, though libcgroup tools remain useful for cgroups v1 systems.

SEE ALSO

cgcreate(1), cgset(1), cgget(1), lscgroup(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid