1. Sort lines of all the named files together and write the result to the specified output. 2. Merge lines of all the named (presorted) files together and write the result to the specified output. Comparisons shall be based on one or more sort keys extracted from each line of input (or, if no sort keys are specified, the entire line up to, but not including, the terminating ), and shall be performed using the collating sequence of the current locale. If this collating sequence does not have a total ordering of all characters (see XBD LC COLLATE ), any lines of input that collate equally should be further compared byte-by-byte using the collating sequence for the POSIX locale. Merge only; the input file shall be assumed to be already sorted. Unique: suppress all but one in each set of lines having equal keys. If used with the -c option, check that there are no lines with duplicate keys, in addition to checking that the input file is sorted. The following options shall override the default ordering rules. When ordering options appear independent of any key field specifications, the requested field ordering rules shall be applied globally to all sort keys. When attached to a specific key (see -k ), the specified ordering options shall override all global ordering options for that key. Consider all lowercase characters that have uppercase equivalents, according to the current setting of LC CTYPE, to be the uppercase equivalent for the purposes of comparison. Ignore all characters that are non-printable, according to the current setting of LC CTYPE. The behavior is undefined for a sort key for which -n also applies. Restrict the sort key to an initial numeric string, consisting of optional characters, optional character, and zero or more digits with an optional radix character and thousands separators (as defined in the current locale), which shall be sorted by arithmetic value. An empty digit string shall be treated as zero. Leading zeros and signs on zeros shall not affect ordering. The keydef argument is a restricted sort key field definition. The format of this definition is: The input files shall be text files, except that the sort utility shall add a to the end of a file ending with an incomplete last line. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. Determine the locale for the definition of the radix character and thousands separator for the -n option. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( Unless the -o or -c options are in effect, the standard output shall contain the sorted input. shall define a key field that begins at field start and ends at field end inclusive, unless field start falls beyond the end of the line or after field end , in which case the key field is empty. A missing field end shall mean the last character of the line. Fields and characters within fields shall be numbered starting with 1. The field number and first character pieces, interpreted as positive decimal integers, shall specify the first character to be used as part of a sort key. If .first character is omitted, it shall refer to the first character of the field. All input files were output successfully, or -c was specified and the input file was correctly sorted. Under the -c option, the file was not ordered as specified, or if the -c and -u options were both specified, two input lines were found with equal keys. The default requirements shall apply, except that if sort encounters an error when opening or reading a file operand, it
Excerpt from a page describing this subject · 24,703 chars · not written by Vinony
via Wikidata · CC0
via Wikidata sitelinks · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).