Personal tools

Difference between revisions of "Sort"

From MohidWiki

Jump to: navigation, search
(New page: Sort is a linux command line to sort ascii lines of text. Sorts the lines by the first field (space is default separator) > cat file.txt | sort Sorts the lines by the second field ...)
 
 
Line 10: Line 10:
  
 
==See also==
 
==See also==
*[[Sed]
+
*[[Sed]]
  
 
==External references==
 
==External references==

Latest revision as of 16:18, 17 April 2010

Sort is a linux command line to sort ascii lines of text.

Sorts the lines by the first field (space is default separator)

> cat file.txt | sort

Sorts the lines by the second field

> cat file.txt | sort +1 -2

+n starts sorting by the n+1-th field -m ends sorting by the m-th field

See also

External references