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. 🙂

arulalan@arul-desktop:~$ curl -A Mozilla http://www.google.com/search?q=Linux |html2text -width 80
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100 41361    0 41361    0     0  32569      0 –:–:–  0:00:01 –:–:– 70222
Web Images Videos Maps News Shopping Gmail more_»
Settings | Sign_in
Google
[Linux               ]Linux [Search]
Advanced_search
About 278,000,000 results(0.21 seconds)
***** Search Results *****
1. **** The_Linux_Home_Page_at_Linux_Online ****
Comprehensive information and resources about the Linux Operating System.
Download_Info – Distributions – Courses – Applications
http://www.linux.org/- Similar
2. **** Ubuntu_Linux ****
Official site; Commercially sponsored Debian-derived Linux distribution
that focuses on usability, a regular 6-month release cycle, and a
commitment to at …
http://www.ubuntu.com/- Cached – Similar
etc…

நன்றிகளுடன்,

த.சு

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s