bedutils / sort

Usage: bedutils sort in.bed [out.bed]

Sorts a BED file.  If out.bed is given, the sorted output is
written there.  Otherwise, in.bed is replaced with a sorted
copy.