grep/display number of lines before and after matching a pattern
I know lots of people are looking for a command-line method on grepping a particular line and some lines BEFORE OR AFTER that pattern matched line…. There are atleast 2 ways which I know :).. Method 1 : using GREP I think it will be self explanatory by the below example… [hchiramm@hchiramm tmp]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0 …