?? sort.1
字號:
.TH SORT 1 .SH NAMEsort \- sort or merge files.SH SYNOPSIS.B sort[.if t \fB\-mubdf\&inrt\fIx\fR.if n -mubdfinrt_________x][ \fB+\fIpos1 \fR [ \fB\-\fIpos2 \fR]] ...[ .B \-o name ] [.B \-Tdirectory ] [ name ] ....SH DESCRIPTION.I Sortsortslines of all the named files togetherand writes the result onthe standard output.The name `\-' meansthe standard input.If no input files are named, the standard input is sorted..PPThe default sort key is an entire line.Default ordering islexicographic by bytes in machinecollating sequence.The ordering is affected globally by the following options,one or more of which may appear..TP 5.B bIgnore leading blanks (spaces and tabs) in field comparisons..TP 5.B d`Dictionary' order: only letters, digits and blanksare significant in comparisons..TP 5.B fFold upper caseletters onto lower case..TP 5.B iIgnore characters outside the ASCII range 040-0176in nonnumeric comparisons..TP 5.B nAn initial numeric string,consisting of optional blanks, optional minus sign,and zero or more digits with optional decimal point,is sorted by arithmetic value.Option.B nimplies option.B b..TP 5.B rReverse the sense of comparisons..TP 5.BI t x`Tab character' separating fields is.IR x ..PPThe notation.BI + "pos1 " "\-\fIpos2"restricts a sort key to a field beginning at.I pos1and ending just before.IR pos2 ..I Pos1and.I pos2each have the form.IB m . n\fR,optionally followed by one or more of the flags.B bdf\&inr,where.I mtells a number of fields to skip from the beginning of the line and.I ntells a number of characters to skip further.If any flags are present they override all the globalordering options for this key.If the.B boption is in effect.I nis counted from the first nonblank in the field;.B bis attached independently to .IR pos2 .A missing\&\fB.\fIn\fRmeans .0;a missing.BI \- pos2means the end of the line.Under the.BI \-t xoption, fields are strings separated by.IR x ;otherwise fields arenonempty nonblank strings separated by blanks..PPWhen there are multiple sort keys, later keysare compared only after all earlier keyscompare equal.Lines that otherwise compare equal are orderedwith all bytes significant..PPThese option arguments are also understood:.TP 5.B cCheck that the input file is sorted according to the ordering rules;give no output unless the file is out of sort..TP 5.B mMerge only, the input files are already sorted..TP 5.B oThe next argument is the name of an output fileto use instead of the standard output.This file may be the same as one of the inputs..TP 5.B TThe next argument is the name of a directory in which temporary filesshould be made..TP 5.B uSuppress all but one in eachset of equal lines.Ignored bytesand bytes outside keysdo not participate inthis comparison..PP.B Examples.Print in alphabetical order all the unique spellingsin a list of words.Capitalized words differ from uncapitalized..PP.ti +8sort \-u +0f +0 list.PPPrint the password file.RI ( passwd (5))sorted by user id number (the 3rd colon-separated field)..PP.ti +8sort \-t: +2n /etc/passwd.PPPrint the first instance of each month in an already sorted fileof (month day) entries.The options.B \-umwith just one input file make the choice of aunique representative from a set of equal lines predictable..PP.ti +8sort \-um +0 \-1 dates.SH FILES/usr/tmp/stm*, /tmp/*: first and second tries fortemporary files.SH "SEE ALSO"uniq(1),comm(1),rev(1),join(1).SH DIAGNOSTICSComments and exits with nonzero status for various troubleconditions and for disorder discovered under option.BR \-c ..SH BUGSVery long lines are silently truncated.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -