I tried to use sort utility and typed sort --help, read one of lines saying its -k option, and part of it:

OPTS is one or more single-letter ordering options [bdfgiMhnRrV], which override global ordering options for that key

I am not getting a clear understanding of the letters option usage.

  • Not an answer, but with GNU sort, the --debug option can be helpful in decipher sort's choices. one example – Jeff Schaller Feb 16 '18 at 17:03

The letters correspond to global options that influence the sort order.

For example:

sort -k2,2nr

means sort by the second column (2,2), numercially (n), in reverse order (r).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.