Gmx selection of COM residue

GROMACS version: 2023.4
GROMACS modification: No

I am trying to obtain the center of mass atom of a protein chain from a protein complex using gmx select and an index file containing each chain.

My selection codes:

  1. gmx select -f complex.gro -s complex.gro -n chains.ndx -on com.ndx -select ‘com of group chA’
    Outputs the very first atom?
  2. gmx select -f complex.gro -s complex.gro -n chains.ndx -on com.ndx -select ‘res_com of group chA’
    Outputs the very first residue?

I can’t seem to get the com of my protein chain. How can I do that with select?