Dear Lina Thanks for your reply. Without the -dist 0.5, I get the -o dist.xvg output, but I need list of the all atoms in group 2 closer than dist to the center of mass of group 1.