Lesson - 14 : UNIX - Sort Commands in Unix

Опубликовано: 02 Октябрь 2024
на канале: Sada Learning Hub
411
6

About sort

sort sorts the contents of a text file, line by line.
Overview

sort is a simple and very useful command which will rearrange the lines in a text file so that they are sorted, numerically and alphabetically. By default, the rules for sorting are:
Lines starting with a number will appear before lines starting with a letter.
Lines starting with a letter that appears earlier in the alphabet will appear before lines starting with a letter that appears later in the alphabet.
Lines starting with a lowercase letter will appear before lines starting with the same letter in uppercase.
The rules for sorting can be changed according to the options you provide to the sort command; these are listed below.
sort syntax

sort [OPTION]... [FILE]...
sort [OPTION]... --files0-from=F