In this article we shall discuss how to Google search on Linux using a tool called Googler. Googler, a feature rich and Python based utility, allows users to query Google (Web and News) using the command line on Linux. This might help developers to integrate google search feature in their applications.
- Provides access to Google Search, Google News and Google Site Search
- Search options such as country, domain, duration or language preference
- Search is fast and tidy with no ads
- Automatic spelling correction can be disabled on demand as well as exact keyword search
- Man page includes example search queries, shell completion scripts..
- Returns the number of results
- Users have the possibility to display first search result in a web browser
- Allows users to start a query at a specific result number
- Google-search keywords supported, for instance site:somesite.com, filetype:mimed etc
Since Googler is based on Python, you would need to make sure that you already have python version 3.3 or higher. Use the command below to know your current version of Python:
In order to install Googler from source, make sure to download the latest version (3.9 at time of writing).
Run the commands below :
tar -xvf v3.9.tar.gz
You may want to read: How to use the Tar command in Linux to compress and extract files
sudo make install
In case you have received the error above, you would need to install the make command as follows :
sudo apt-get install –reinstall make
Now we try again the command below :
sudo make install
sudo cp googler-completion.bash /etc/bash_completion.d/
Once Googler is installed, You can start to perform some basic Google searches from your terminal. For instance, the command below will display information about net2.com:
In the example below, we will search for the quoted words “monitoring tools guide” in net2.com :
The command above used the following options:
- -n num – displays 8 results per page (default is 10)
- -w – Google site (net2.com) search
At the end of the search query, you may have noticed the omni-prompt below . Enter a question mark to view the description of each switch :
If you want to search for the latest news about a given subject, simply type in the below command and hit
Googler – N space missions
You can search an alias for a specific search using the command below :
alias spacemissions=’googler -n 4 space missions’
Googler is a powerful tool that can perfectly mimic standard Google search. This functionality can be used for instance by developers to create a customized light browser which is Google based or for those who want to build a search engine or a website statistics application…the options are limitless…
For more information about Googler, Visit the Googler Github repository or check the Googler man page.