[] Sort command Linux common commands

sort - sort lines of text files

sort command will be used to sort the contents of a text file.

sort can for the content of the text file to the line units of the sort.

 

grammar:

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

Sort [- bcdfimMnr ] [- O <output file>] [- T <separator character>] [+ <start column> - <End field>] [- Help ] [- verison of ] [File]

 

parameter:

  • -b ignore the space character in front of each line start out.
  • -C Check whether the file has been sorted in the order.
  • When -d sorting, processing letters, numbers and space characters, but ignore other characters.
  • -F When ordering, lowercase letters as uppercase letters.
  • -I When ordering, in addition to ASCII characters between 040-176, ignore the other characters.
  • -m to merge several files sorted.
  • -M The first three-letter abbreviations be sorted by month.
  • -n sorted in accordance with size values.
  • -o <output file> The results sorted into the specified file.
  • -r sorted in reverse order.
  • -t field when <separator character> Specifies the sort used separator characters.
  • + <Start column> - <End field> specified fields to sort, the range of the field from the start to the end of the previous field field.

 

Example:

 

Guess you like

Origin www.cnblogs.com/zoe233/p/11802572.html