1

i have a command that prints out some statistical information that looks like this:

Detailed Hardware Status Dump:

...

Summary:

Memory info: OK
HDD info:  OK
...

I'd like to ./dump_hw_status | grep 'Summary:' so that grep start to output everything from the first line matching 'Summary:'

is there any simple way to do it?

JMW
  • 1,463
  • 4
  • 19
  • 27

1 Answers1

4

One way using GNU sed:

./dump_hw_status | sed -n '/^Summary:/,$p'

This will print everything from the line starting with "Summary:" to the end of the file.

Steve
  • 175
  • 1
  • 4
  • 7