Googler: A Command Line Tool to Do ‘Google Search’ from Linux Terminal

Today, Google search is a well known and the most-used search engine on the World Wide Web (WWW), if you want to gather information from millions of servers on the Internet, then it is the number one and most reliable tool for that purpose plus much more.

Many people around the world mainly use Google search via a graphical web browser interface. However, command line geeks who are always glued to the terminal for their day-to-day system related tasks, face difficulties in accessing Google search from command-line, this is where Googler comes in handy.

Read Also: Wikit – A Command Line Tool to Search Wikipedia in Linux

Googler is a powerful, feature-rich and Python-based command line tool for accessing Google (Web & News) and Google Site Search within the Linux terminal.

Note: Googler is not in any way associated to Google.

How Does Googler Works?

It provides an interface from the command line to Google search and displays results inform of title, URL and abstract information in pages, with page navigation similar to that on a GUI web browser.

Watch the quick demo of Googler.

Google Search from Linux Terminal

Users can integrate it with a text-based web browser and open the result directly in the web browser.

It supports sequential searches in a single instance and importantly, users do not need to master any usage options as the shell completion scripts automatically invokes them.

Features of Googler

  1. Offers access to Google Search, Google Site Search, Google News.
  2. It is fast and clean with custom colors and no ads, stray URLs or clutter included.
  3. Allows navigation of search result pages from omniprompt.
  4. Supports fetching of number of results in a go, users can start at the nth result.
  5. Users can disable automatic spelling correction and search exact keywords.
  6. Supports limiting of search by attributes such as duration, country/domain specific search (default: .com), language preference.
  7. Supports Google search keywords in the form filetype:mime, site:somesite.com and many others.
  8. Permits non-stop searches: start new searches at omniprompt without exiting.
  9. Supports HTTPS proxy services.
  10. Ships in with a man page which includes examples, shell completion scripts for Bash, Zsh and Fish.
  11. Users can optionally open first search result in a web browser.

How To Install Googler in Linux

Users of Ubuntu Linux and its derivatives such as Linux Mint, Xubuntu can install it via this PPA by executing the commands below:

$ sudo add-apt-repository ppa:twodopeshaggy/jarun
$ sudo apt-get update
$ sudo apt-get install googler

Important: If in case above installation instructions fails to install Googler, then you need to install it from source using latest version as shown.

Other distributions can install Googler from source using following instructions.

First download the latest version of Googler (at the time writing the latest version is v2.9).

$ cd Downloads
$ wget -c https://github.com/jarun/googler/archive/v2.9.tar.gz
$ tar -xvf  v2.9.tar.gz
$ cd  googler-2.9
$ sudo make install 
$ cd auto-completion/bash/
$ sudo cp googler-completion.bash  /etc/bash_completion.d/

How to Use Googler in Linux Terminal

The following are some examples showing how Googler works in Linux, the basic command below will show information about tecmint.com:

$ googler tecmint.com
Search Google from Linux Commandline
Search Google from Linux Commandline

At the end of the search result page, you can view the omniprompt help page by entering the “?” character and pressing Enter. Each key has a detailed functionality description alongside it.

Google Search Options
Google Search Options

In the example, we will search for the quoted words (Linux command line tricks) on tecmint.com.

$ googler -n 8 -w tecmint.com \"Linux command line tricks\"

where the options:

  1. -n num – tells googler to display at most 8 results per a page (default is 10).
  2. -w – enables Google site(tecmint.com) search.
Google Site Search Results
Google Site Search Results

You can as well display results of latest news concerning Linux from the Google search news section by using the -N switch as follows:

$ googler -N Linux 
Search Linux News from Commandline
Search Linux News from Commandline

Set an alias to get four results showing the meaning of a word (tecmint in this case) like so:

$ alias tecmint='oogler -n 4 tecmint'
$ tecmint 
Google Search for Keyword
Google Search for Keyword

Visit the Googler Github repository for more information and usage or view the Googler man page.

$ man googler 

Googler is a handy tool, it works perfectly and reliably for Linux users who spend most of their time on the terminal and want to search the web from a text-based interface. Remember to share your thoughts about Googler in the comments.

If you read this far, tweet to the author to show them you care. Tweet a thanks
Aaron Kili
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

21 thoughts on “Googler: A Command Line Tool to Do ‘Google Search’ from Linux Terminal”

  1. I am using googler on Ubuntu 18 and am unable to open any search results in a browser even after setting the BROWSER=w3m. I have also installed w3m and it works fine. I must say that the utility is awesome and I would like to use it further. Thanks

    Reply
      • Does this “fixed some bugs for me” include opening up results in browsers like elinks or w3m? I still cannot open any results. Dev suggest we grab the latest development branch and try but that didn’t help me. To file a bug, we have to add some logs in gist and a few other items/results from “googler -d” but I haven’t had a chance yet.

        Just checking if anyone else is having the same issue other than the two of us

        Reply
  2. Those interested in this command line utility might also enjoy “surfraw” – a much more comprehensive command line search facility for many different types of each facilities other than Google. And partly written by none other than Julian Assange.

    Reply
  3. i installedin redhat linux, giving the below error, is python3 module required here, please confirm.

    # googler techmint.com
    /usr/bin/env: python3: No such file or directory

    # ls -l /usr/bin/python3
    ls: cannot access /usr/bin/python3: No such file or directory

    Reply
      • Even installing python more than 3 version it shows me this message

        [Randomperson@localhost ~]$ googler tecmint.com
        Traceback (most recent call last):
          File "/usr/bin/googler", line 29, in 
            from http.client import HTTPSConnection
        ImportError: cannot import name 'HTTPSConnection'
        
        Reply
    • `googler` has nothing to do with Ubuntu login. You can, however, remove it using `Ctrl Alt F1` and `sudo apt purge googler`.

      Reply
    • @Amrendra

      Try the following steps:

      1. At login screen, press Ctrl+Alt+F1 get a virtual console.
      2. Login with your username and password
      3. Run the command below to rename the hidden file, .Xauthority in your home directory.
      mv .Xauthority .Xauthority.bak
      4. Then switch back to the login screen using Ctrl+Alt+F7.

      I hope this will help, if it doesn’t try to get back.

      Reply
  4. I liked Googler but have not used it in a while. The one problem I had was opening search results in either w3m or elinks. This CLI rookie would appreciate any suggestions

    Reply
    • @s_dahl

      Set the BROWSER environment variable as follows:
      export BROWSER=w3m
      or
      export BROWSER=elinks

      Alternatively, you can set it permanently in the .bash_profile(user-specific configuration) or /etc/profile(for system wide configuration) file
      After that run the command below for the changes to take effect:
      source .bash_profile
      or
      source /etc/profile

      Reply

Got something to say? Join the discussion.

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.