User Tools

Site Tools


blog:search_google.com_from_the_linux_command_line

Search Google.com from the Linux command line

You can search Google.com from the Linux command line without using a CLI web browser like lynx or Elinks. All you need is the curl and html2text packages installed. Then you issue the following command:

curl -A Mozilla http://www.google.com/search?q=Linux |html2text -width 80

where you can replace Linux with another keyword of your choice. The results will be displayed in your console application with a width of 80.

I have created a bash shell function for this:

google() { curl -A Mozilla http://www.google.com/search?q=$* | html2text -width 80; }

Now you can just google linux

Reference: http://tips4linux.com/search-googlecom-from-the-linux-command-line/

~~LINKBACK~~

Discussion

Enter your comment. Wiki syntax is allowed:
  _      __  _   __   __ __  _____   _  __
 | | /| / / | | / /  / //_/ / ___/  | |/_/
 | |/ |/ /  | |/ /  / ,<   / (_ /  _>  <  
 |__/|__/   |___/  /_/|_|  \___/  /_/|_|
 
blog/search_google.com_from_the_linux_command_line.txt · Last modified: 2009-08-11 08:09 by brb