Copyright (C) 2008 Henri Hakkinen
Modified (2015) by Arun Prakash Jana engineerarun@gmail.com
google is a command line tool for doing Google searches from the terminal. For each result it shows the header, URL and text context. You can also navigate back and forth to fetch the next or previous results. On link-recognising terminal emulators like AltYo, use Ctrl-Left click to open the URL in your default browser.
Usage: google [OPTIONS] KEYWORDS...
Options
-s N start at the Nth result
-n N shows N results (default 10)
-l LANG display in language LANG, such as fi for Finnish
-C disable color output
-j open the first result in a web browser
-f MIME search for specific file type
-t dN time limit search [e.g. d5: 5 days, w5: 5 weeks, m5: 5 months, y5: 5 years]
Keys
n, p press 'n' or 'p' and Enter to navigate forward and backward
Examples:
- Google hello world:
$ google hello world
- To fetch 15 results updated within last 2 months, starting from the 3rd result for the string cmdline utility in site tuxdiary.com, run:
$ google -n 15 -s 3 -t m2 cmdline utility site:tuxdiary.com
Report bugs to https://github.com/jarun/google-cli/issues
See the manual page for full details. Have fun!
google-cli requires Python 2.7.x or Python 3.x to work.
The following steps are tested on Ubuntu 14.04.3 x64_64:
$ git clone https://github.com/jarun/google-cli/ $ cd google-cli $ sudo make install
To remove, run:
$ sudo make uninstall
25 Aug, 2015
- Add Python 3.x support (thanks Narrat)
22 Aug, 2015
- Add navigation support
17 Aug, 2015
- Support for time limited search
- Throw error in case of google error due to unusual activity from IP
- Support file type in search
16 Aug, 2015
- Use https
- Handle google redirections (error 302)
- Show full text snippet of search results
- Unicode in URL works
- Colour output by default, -C now disables it (toggled)
- The first URL now correctly opens in browser with -j switch
- Honour -j even if -n is not used and open the result in browser
- Fixed character encoding problem in URL e.g. double quotes (%22) changed to %2522
- Skip browser to show result in console for empty URL, e.g., first result of ‘define hello’
Initially I raised a pull request but I could see that the last change was made 7 years earlier. In addition, there is no GitHub activity from the original author (Henri Hakkinen: https://github.com/henux ) in past year. I have created this independent repo for the project with the name google-cli. Would love to push the changes back to original repo if the author contacts. I retained the original copyright information.
