how do I sort lists like the one below using sort
or any related commands?
12.ale.panal.sel.blr.teta.hf.ew.rr.lwq.ors.2018
34.ev.we.ars.lmn.2017
5.lam.bere.meto.belagn.hede.we.e.2020
54.arad.met.kal.sil.tek.br.yz.2005
I want to sort them according to the last word which is the year chronologically?
N.B basically something like sort -t. -k-1
although -1
is not allowed. Any command just to address the last part?
-t
flag. – Eduardo Trápani Jun 08 '20 at 22:56sort
sorts based on fields (see the answer linked above). By default the field separator is whitespace, with-t.
the field separator will be a dot. You' most likely can pick it up from there. – Eduardo Trápani Jun 08 '20 at 23:00