use grep & awk to get ed2k links in the webpage in cygwin grep "href="ed2k" c.htm |awk -F '"' '{print $2}' >ed2k.txt