Originally Posted by ramkisak
I have been using the -k option, but this is applicable when the lines are separated by fields delimited by field separator such as space or tabs. In my case the lines in my file have different number of fields, when the space is considered as a field separator. However the information that I want the sorting to be based upon are in the same column in each line, hence DOS sort does the job. However I want to know how to achieve this in LINUX if there is a proper option in sort. Since I could not find one, hence this post
You don't show any relevant example and do not mention why the given solution does not work.
The -k<number> (-k21) option tells sort to start sorting at column 21 (and everything after column 21 if needed!!).
The -k<number>,<number> (-k21,21) option sorts only column 21.
Without knowing what the input is like and how, exactly, you want this to be sorted we can only give you a global answer (which was given by Firerat).