shpsort - rewrite a shapefile sorted by a field or by the geometry
shpsort infile outfile field[;...] 
Rewrite a shapefile sorted by a field or by the geometry. For polygons, sort by area, for lines sort by length and do nothing for all others.
shpsort is part of shapelib, maintained by Frank Warmerdam.