How to see the cgroup of a process
How to see the cgroup of a process?
Look in the 'cgroup' file within the /proc directory and the related process ID.
cat /proc/PID/cgroupThe control group of a process can be retrieved from the /proc directory. We only need to know the PID of the process, which can be found using ps or pidof.
Usage
If we know that our PID is 1234, then showing the cgroup is as easy as using cat to see the contents of the ‘cgroup’ file.
cat /proc/1234/cgroup
To see the cgroup for the nginx process (or one of them), we could something like this.
cat /proc/$(pidof -s nginx)/cgroup
Want to see the value directly from the process listing?
Relevant FAQ: How to see cgroup in ps output?