?? grep.1
字號:
.TH GREP 1 .SH NAMEgrep, egrep, fgrep \- search a file for a pattern.SH SYNOPSIS.B grep[ option ] ...expression [ file ] ....LP.B egrep [ option ] ...[ expression ][ file ] ....PP.B fgrep[ option ] ...[ strings ][ file ].SH DESCRIPTIONCommands of the.I grepfamily search the input.I files(standard input default)for lines matchinga pattern.Normally, each line foundis copied to the standard output;unless the.B \-hflag is used,the file name is shown if there is more than one input file..PP.I Greppatterns are limited regular expressions in the style of.IR ed (1);it uses a compact nondeterministic algorithm..I Egreppatterns are full regular expressions;it uses a fast deterministic algorithm thatsometimes needs exponential space..I Fgreppatterns are fixed strings; it is fast and compact..PPThe following options are recognized..TP.B \-vAll lines but those matchingare printed..TP.B \-cOnly a count of matching lines is printed..TP.B \-lThe names of files with matching lines are listed (once)separated by newlines..TP.B \-nEach line is preceded byits line number in the file..TP.B \-bEach line is preceded by the block numberon which it was found.This is sometimes useful in locatingdisk block numbers by context..TP.B \-sNo output is produced, only status..TP.B \-hDo not print filename headers with output lines..TP.B \-yLower case letters in the pattern will also matchupper case letters in the input.RI ( greponly)..TP.BI \-e " expression"Same as a simple.I expression argument,but useful when the.I expressionbegins with a \-..TP.BI \-f " file"The regular expression.RI ( egrep )or string list.RI ( fgrep ) is taken from the.I file..TP.B \-x(Exact) only lines matched in their entirety are printed.RI ( fgreponly)..PPCare should be taken whenusing the characters$ * [ ^ | ? \' " ( ) and \e in the.I expressionas they arealso meaningful to the Shell.It is safest to enclose theentire.I expressionargument in single quotes \' \'..PP.I Fgrepsearches for lines that contain one of the (newline-separated).I strings..PP.I Egrepaccepts extended regular expressions.In the following description `character' excludesnewline:.IPA \e followed by a single charactermatches that character..IPThe character ^($) matches the beginning (end) of a line..IPA .B .matches any character..IPA single character not otherwise endowed with specialmeaning matches that character..IPA string enclosed in brackets [\|]matches any single character from the string.Ranges of ASCII character codes may be abbreviatedas in `a\-z0\-9'.A ]may occur only as the first character of the string.A literal \- must be placed where it can't bemistaken as a range indicator..IPA regular expression followed by * (+, ?) matches a sequenceof 0 or more (1 or more, 0 or 1)matches of the regular expression..IPTwo regular expressions concatenatedmatch a match of the first followed by a match of the second..IPTwo regular expressions separated by | or newlinematch either a match for the first or a match for thesecond..IPA regular expression enclosed in parenthesesmatches a match for the regular expression..LPThe order of precedence of operatorsat the same parenthesis levelis [\|] then*+? then concatenation then | and newline..SH "SEE ALSO"ed(1),sed(1),sh(1).SH DIAGNOSTICSExit status is 0 if any matches are found,1 if none, 2 for syntax errors or inaccessible files..SH BUGSIdeally there should be only one.I grep,but we don't know a single algorithm that spans a wide enoughrange of space-time tradeoffs..PPLinesare limited to 256 characters;longer lines are truncated.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -