If Not True Then False

Google search from Linux and UNIX command line - Comment Page: 1

Today I started thinking that how cool is do some Google searches straight from command line. First I try to find some ready tricks from the Internet, but I couldn’t find quickly anything good. So I decide do a simple Bash function that can take Google search as parameter and open Firefox Browser (tab) with Google search. Sounds easy… :) First we need Google search URL without search...
Categories:

11 Comments

Leave a Comment

Your email address will not be published. Required fields are marked *

Input your comment.
help

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Input your name.

Sindhu

I get a “no match found for ” in my ZSH, any idea why? I even put in alias google=`noglob google`

reply Reply
JR

Hi Sindhu,

I tested a bit this function on ZSH shell and the problem seems to be that, how to ZSH shell handles special characters, such as question mark (?) and ampersand (&). This is easy to fix, simply use backslash (\) before question mark (?) and create function like following:


function google() { firefox http://www.google.com/search\?hl=en#q="`encode $@`" ;}

Did you get it to work? :)

reply Reply
Vaibhav

Wow! Worked like a charm.

Did have to modiry command firefox with firefox --no-remote -P though!

Loved it! Thanks! :)

reply Reply
Andy

Thanks a lot for this information. Would you please show how to search startpage.com or ixquick from the command line. Again, thanks for the info.

reply Reply