- 论坛徽章:
- 7
|
如果用grep匹配了某一行,能否一起显示下面接连的几行?
- r2007@www r2007 $ man grep|grep -A4 -- "-A"
- -A NUM, --after-context=NUM
- Print NUM lines of trailing context after matching lines.
- Places a line containing -- between contiguous groups of
- matches.
- r2007@www r2007 $ grep --version
- grep (GNU grep) 2.5.1
- Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
- This is free software; see the source for copying conditions. There is NO
- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
复制代码 |
|