SORT.1
Upload User: jnzhq888
Upload Date: 2007-01-18
Package Size: 51694k
Code Size: 2k
Category:

OS Develop

Development Platform:

WINDOWS

  1. .TH SORT 1
  2. .SH NAME
  3. sort - sort a file of ASCII lines
  4. .SH SYNOPSIS
  5. fBsortfR [fB-bcdf&imnrufR]fR [fB-tfIcfR]  [fB-o fInamefR] [fB+fIpos1fR] [fB-fIpos2fR] fIfilefR ...fR
  6. .br
  7. .de FL
  8. .TP
  9. \fB\$1\fR
  10. \$2
  11. ..
  12. .de EX
  13. .TP 20
  14. \fB\$1\fR
  15. # \$2
  16. ..
  17. .SH OPTIONS
  18. .FL "-b" "Skip leading blanks when making comparisons"
  19. .FL "-c" "Check to see if a file is sorted"
  20. .FL "-d" "Dictionary order: ignore punctuation"
  21. .FL "-f" "Fold upper case onto lower case"
  22. .FL "-i" "Ignore nonASCII characters"
  23. .FL "-m" "Merge presorted files"
  24. .FL "-n" "Numeric sort order"
  25. .FL "-o" "Next argument is output file"
  26. .FL "-r" "Reverse the sort order"
  27. .FL "-t" "Following character is field separator"
  28. .FL "-u" "Unique mode (delete duplicate lines)"
  29. .SH EXAMPLES
  30. .EX "sort -nr file" "Sort keys numerically, reversed"
  31. .EX "sort +2 -4 file" "Sort using fields 2 and 3 as key"
  32. .EX "sort +2 -t: -o out" "Field separator is fI:fP"
  33. .EX "sort +.3 -.6" "Characters 3 through 5 form the key"
  34. .SH DESCRIPTION
  35. .PP
  36. .I Sort
  37. sorts one or more files.
  38. If no files are specified, fIstdinfR is sorted.
  39. Output is written on standard output, unless fB-ofP is specified.
  40. The options fB+fIpos1 fB-fIpos2fR use only fields fIpos1fR
  41. up to but not including fIpos2fR as the sort key, where a field is a
  42. string of characters delimited by spaces and tabs, unless a different field
  43. delimiter is specified with fB-tfR.
  44. Both fIpos1fR and fIpos2fR have the form fIm.nfR where fImfR tells
  45. the number of fields and fInfR tells the number of characters.
  46. Either fImfR or fInfR may be omitted.
  47. .SH "SEE ALSO"
  48. .BR comm (1),
  49. .BR grep (1),
  50. .BR uniq (1).