$ sort --key=1.3,1.3 inputfile pp0dd aa1bb aa3ya ax5aa fg7ds
sorting help page:
[...]
-k, --key = POS1 [, POS2]
run the key in POS1 (start 1), end it on POS2 (default end of line)
[...]
POS - F [.C] [OPTS], where F is the number of the field, and C is the position of the character in the field; both are sources 1. If neither -t or -b are valid, the characters in the field are counted from the beginning of the previous space. OPTS is one or more one-letter order options that override the global order parameters for this key. If no key is specified, use the entire string as the key.
Using the --key = 1.3.1.3 key, you said that there is only one field (the entire line) and that you are comparing the position of the third character of this field.
source share