Posts

Showing posts from June, 2024

How to print only the previous 5th and 6th lines using the 'grep' command

How to print only the previous 5th and 6th lines using the 'grep' command grep total -B 5 -w my.test | awk '( ((NR%7) == 1) || ((NR%7) == 6 )) { print $0 } ' | more