Piping curl output into grep Piping curl output into grep curl curl

Piping curl output into grep


Curl detects that it is not outputting to a terminal, and shows you the Progress Meter. You can suppress the progress meter with -s.

The HTML data is indeed being sent to grep. However that page does not contain the text "Gene Symbol". Grep is case-sensitive (unless invoked with -i) and you are looking for "Gene symbol".

$ curl -s www.ncbi.nlm.nih.gov/gene/823951 | grep "Gene symbol"    <dt class="noline"> Gene symbol </dt>

You probably also want the next line of HTML, which you can make grep output with the -A option:

$ curl -s www.ncbi.nlm.nih.gov/gene/823951 | grep -A1 "Gene symbol"    <dt class="noline"> Gene symbol </dt>    <dd class="noline">AT3G47960</dd>

See man curl and man grep for more information about these and other options.