awk '/PATTERN/ {for(i=1; i<=5; i++) {getline; print}}' filename
The above command will search the key word "PATTERN" once it is matched, it will print the below 5 lines after the search string from the text file.
The above command will search the key word "PATTERN" once it is matched, it will print the below 5 lines after the search string from the text file.
No comments:
Post a Comment