Need help with Unix

sort -t "~" -k 1.19,1.29 -k 2.1,2.5 

in unix

  • I have to understand what exactly this command will do ?:wall:

This command sort the file based on the first field's 19-29 characters and second field's 1-5 characters. Here delimiter is '~'.

-k column-no.starting-char,column-no.ending-char

It wont consider other than the specified char in a field for sorting.

1 Like

Hey Thanks a lot....
just a concern, what if my file dont have "~" and i mention in my unix commad above?

It will take whole line as a first column and sort based on that.
If you dont set -t option, by default it will set as <space>.
I hope you are clear.
Cheers,
Ranga:-)

yo....that was helpful...thanks a ton