How to combine wget and grep

Keeping this around for the sake of completeness.

Your example should actually work. The syntax is correct, and here's a screencast I just took demonstrating it, with a good old GNU wget 1.13.4.

wget -q some-url -O - | grep something

So assume your pattern is wrong and grep will just output everything it got.


The easiest way is to use curl with the option -s for silent:

curl -s http://somepage.com | grep whatever

This bug was in v1.12.1 fixed in another version. Currently I use v1.15 and it works as expected.

Tags:

Grep

Wget