I have a file with the below content.
.
.
hello
.
.
.
world
.
.
hello
.
.
.
.
.
world
.
.
the dots indicates the other lines in the file. Here what I need to gerp only the lines hello and world. That means the output should something like below.
hello
world
hello
world
How to accomplish this ?
Thanks,
Best Answer
Using
grep
:Using
awk
: