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 parameter and it looks like this: http://www.google.com/search?hl=en#q= Next is good to do some tests with Firefox, URL and search words from command line: firefox http://www.google.com/search?hl=en#q=test Works as it should work firefox http://www.google.com/search?hl=en#q=test more words Not...

11 comments on “Google search from Linux and UNIX command line - Comment Page: 1

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

      Reply
    2. 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 [email protected]`" ;}
      

      Did you get it to work? :)

      Reply
    3. Excellent tip .. Thanks

      Reply
    4. I wrote a Google Cli Search tool for linux, you may be interested in Gisele

      Reply
      • Hi Boris,

        Thanks! Looks very nice! :)

        Reply
      • really thanks for this – you saved my day!

        Reply
    5. Wow! Worked like a charm.

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

      Loved it! Thanks! :)

      Reply
    6. 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
    7. How would this work with startpage.com?

      Reply
    8. thanks a lot………..
      very m,uch creative,,

      Reply
    9. Thanks, added to my .bashrc immediately

      Reply

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close