How to create two indexes groups using gmx select

GROMACS version: 2019.6
GROMACS modification: No

I’m trying to create a bash script to run several analyses in a single execution. My system is a protein embedded in a membrane and create some index files using gmx select as described below:

gmx select -s $tpr -f $gro -select ‘name CA and resid 1 to 250’ -on chain_A.ndx

In this case, the created index file only have one group. Is it possible to create two indexes group in the same index file using gmx select only one time?
I’m asking this question because I need to use gmx bundle that request two indexes group for execution that should be provided by an index file.

Thanks in advance,

Fred

If you accept using the interactive mode of gmx select, i.e., without the -select option, you can do multiple selections before finishing.

You can also combine multiple selection files, e.g.:
cat file1.ndx file2.ndx > combined.ndx

Hi Magnus,
Thank you so much. It’s so easy that my question seems stupid now. Ask the experts in the gromacs’ forum is always the best alternative.
Thank you again.