How To Search Google using The Linux Terminal

You don’t need a graphical interface to search the web. Googler is a powerful command-line tool that allows you to search Google, Google News, and specific websites directly from your Linux terminal. Below, you will find a complete guide on how to install Googler on Ubuntu and Arch Linux, along with essential commands to boost your productivity.

What is Googler?

Let’s suppose you are working in the terminal (change permissions, edit configuration files, etc.) and, to save time, you can search directly on Google without leaving the command line. The application for Google searching in the command-line is called Googler.

It can be used as a standalone application, or in combination with a text-based web browser (example: Links). Googler is developed in Python and can be found in GitHub.

Prerequisites of Googler: it requires a version of Python greater than 3.3. To check which version of Python you have installed run the command:

python3 –version

How to Install Googler

Installing Google in Arch Linux

As usual, Arch Linux does not disappoint anyone and allows Googler to be installed from AUR:

yaourt -S googler

or

pacaur -S googler

Get to know more about the system with our Arch Linux terminology guide.

Installing Googler in Ubuntu

Unfortunately, Googler is not yet available in Ubuntu warehouses, but it can be installed directly from GitHub by following the steps below.

Install Git (if you do not already have it installed):

sudo apt-get install git

• Clone the repository and install. Run the following commands:

cd /tmp
git clone https://github.com/jarun/googler.git
cd googler
sudo make installcd auto-completion/bash/
cd auto-completion/bash/
sudo cp googler-completion.bash /etc/bash_completion.d/

Curious about Ubuntu? Read how to increase the performance of an Ubuntu system.

How to use Googler? Essential Commands

It is extremely simple to use. Run the googler command followed by your query.

Basic search in Googler

googler what-we-want-to-look for

Tip: If you write the number attached to each search result and press ENTER, the link opens in the default browser in the system.

Google News Search

To search specifically in News, use the –news or -N flag:

googler –news your_query

googler -N your_query

Googler search on a particular website

To search within a specific domain (like searching specifically on mvps.net):

googler -w query field

googler -w mvps.net linux

Limit the number of results

If you think there are too many results (the first 10 are displayed), you can limit their number using the –count=N parameter, where N represents the desired number of displayed results:

googler –count=N query

View the Googler manual

To see all the options Googler allows, just look at its manual using the famous man command:

man googler

FAQ about Googler in the Linux Terminal

Can I open Googler results in a text-based browser?
Yes, Googler integrates well with text-based browsers like lynx, links, or w3m. This allows you to browse the web entirely from the terminal without launching a graphical interface, which is perfect for headless servers.
Does Googler work on Windows?
Googler is primarily designed for Linux and Unix-like systems. However, you can run it on Windows using WSL (Windows Subsystem for Linux) or by using Cygwin to provide the necessary terminal environment.
How do I update Googler?
If you installed Googler via Git (as shown in the Ubuntu guide), you can update it by navigating to the cloned folder and pulling the latest changes: git pull followed by sudo make install. If you used Arch Linux AUR, simply run your package manager update command.
Is Googler safe to use?
Yes, Googler is an open-source tool that simply scrapes Google search results and displays them in your terminal. It does not track your data, but keep in mind that Google itself will still see the search queries coming from your IP address.

About the author

Ilias spiros
By Ilias spiros

Categories