How to use grep command

I want to search pattern in between two words in a file

so how to write query by using grep command??

Also want to get two words..

Welcome to the forum ! :slight_smile:

This had been answered many times and you could try searching the forums.

If you think, that this is the first time its questioned here then provide a sample input and output to help you much faster

without the exact requirement, its very difficult to answer.

I assume you want to take out the details between two words in afile.You can try the below one:

sed -n '/word1/,/word2/p'  file