I have a file with hounded of thousands lines. I need to grep from a line to another line and include everything between these lines i.e lines from Wed Nov 25 23:08:01 GMT 2015 to Wed Nov 25 23:59:24 GMT 2015[...]abcabcabcWed Nov 25 23:08:01 GMT 2015defdefdefdef... (1000 lines with def)Wed Nov 25 23:59:24 GMT 2015xyzxyzxyz[...]Can you suggest what is the right grep expression?
Grep from a line to a line
grep
A combination of sed and grep should do the trick. Something like this:sed '1,/Wed Nov 25 23:08:01 GMT 2015/d;/Wed Nov 25 23:59:24 GMT 2015/,$d' < file.txt | grep <yourstring>Note that this example will not include the lines matching the dates, just everything in between them.