What is the default delimiter for sort's -k option? I searched some man page and samples and still feel lost.


1 Answer 1


The GNU sort documentation for the -t option says

By default, fields are separated by the empty string between a non-blank character and a blank character. By default a blank is a space or a tab, but the LC_CTYPE locale can change this.

POSIX says

If -t is not specified, <blank> characters shall be used as default field separators; each maximal non-empty sequence of <blank> characters that follows a non- <blank> shall be a field separator.

Both amount to the same thing: by default, any sequence of whitespace characters separate fields, and the whitespace characters are part of the (following) field.


  foo  bar

(with two spaces at the beginning) is treated by sort as containing two fields,




(again with two spaces at the beginning).


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .