I have a file
ksh$ cat test b d b c a b a a
I want to sort on first field but I want stable sort i.e. order of 2nd field should remain the
You must specify the end field:
sort -k1,1 -s test
You forgot to constrain the key fields. By default it uses until the end of the line.
sort -k1,1 -s t.txt