- 论坛徽章:
- 0
|
回复 6# yddll
-p[Separator]
Displays the entire paragraph containing matched lines. Paragraphs are delimited by paragraph separators, as specified
by the Separator parameter, which are patterns in the same form as the search pattern. Lines containing the paragraph
separators are used only as separators; they are never included in the output. The default paragraph separator is a
blank line.
现在设置-p[root]
结果无法查询到:
vi a.txt
"a.txt" [New file]
root
hello
1
2
3
4
root
hi
root
kk
root
pp
root
cc
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"a.txt" [New file] 14 lines, 51 characters
<51 CESHIBMP [bmp] :/enip/bmp/userfile/libiao/test>grep -p[root] a.txt
No match. |
|