« Back to Processes: Frequently Asked Questions

How to see the cgroup of a process

The 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.


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?

Relevant commands in this article

Like to learn more about the commands that were used in this article? Have a look, for some there is also a cheat sheet available.

  • cat
  • pidof
  • ps

Other questions related to Processes


Is the described answer not working or incorrect, got another tip or question? Share your thoughts!