-sort <property> <order>
This option sorts atoms by increasing or decreasing values of X, Y or Z coordinate, or values of the atomic weight.
The command-line parameters of importance are:
This option does not transform the system or move atoms; it just changes the order in which they appear in the final file.
By default atoms are not rearranged at all.
pikashu initial.cfg final.xyz -sort spieces up
This will rearrange the order in which atoms are written, sorting them by increasing value of their atomic weigth.
pikashu initial.cfg final.xyz -sort z down
This will sort atoms by decreasing values of their Z coordinate.