up lines after a match

how to use " grep " command to find a match and to print followup of 10 lines from the match. this i need to get some error statements from log files. (else need to download use match for log time and then copy the content). Instead of downloading bulk size files i need to run a command to get those number of lines.


A default install of Solaris 10 or 11 will have the /usr/sfw/bin file tree. Gnu grep - /usr/sfw/bin/ggrep is there. ggrep supports /usr/sfw/bin/ggrep -A 10 [pattern] [file] which does what you want.

Solaris 9 and older may not have it. Or your system may not have been a default install. Check.

链接地址: http://www.djcxy.com/p/19636.html

上一篇: 什么是grep的替代/等价物

下一篇: 在比赛结束后上线