Home Terminal Tuts How to install and use Googler for command-line web search

How to install and use Googler for command-line web search

Googler is a versatile command line tool that allows you to perform Google searches directly from your Linux terminal. This guide explains how to install Googler and use its features effectively, enhancing your ability to quickly search the web and access information without leaving the command line.

by Divya Kiran Kumar
Published: Updated:
google search in linux terminal

In today’s fast-paced tech environment, being efficient is of utmost importance. For those who prefer streamlined workflows and terminal enthusiasts, Googler is a powerful ally. This command line tool has revolutionized how we approach Google searches by integrating them seamlessly into our command line activities.

By keeping our searches in the same window where we code, script, or manage systems, Googler not only enhances productivity but also minimizes distractions. This makes it a highly appreciated tool for programmers, system administrators, and tech enthusiasts alike.

Why use Googler?

Before diving into the how-tos, let’s talk about why Googler is worth your time. If you’re like me, minimizing distractions is key. Switching between a browser and a terminal for every little query can disrupt your workflow. Googler solves this by keeping your searches streamlined and integrated with your command line activities.

Setting up Googler

Step 1: Installation

First things first, you need to install Googler. It’s available for Linux, macOS, and Windows (with a bit of tweaking). For Linux users, you can typically install it using your package manager.

Debian-based distributions (like Ubuntu)

For Debian and its derivatives, the process is similar to Ubuntu:

sudo apt install googler

Example output on Ubuntu 22.04 LTS:

foss_linux@fosslinux-ubuntu:~$ sudo apt install googler
[sudo] password for foss_linux: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
googler
0 upgraded, 1 newly installed, 0 to remove and 42 not upgraded.
Need to get 49.5 kB of archives.
After this operation, 163 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 googler all 4.3.2-1 [49.5 kB]
Fetched 49.5 kB in 0s (146 kB/s) 
Selecting previously unselected package googler.
(Reading database ... 244692 files and directories currently installed.)
Preparing to unpack .../googler_4.3.2-1_all.deb ...
Unpacking googler (4.3.2-1) ...
Setting up googler (4.3.2-1) ...
Processing triggers for man-db (2.10.2-1) ...

Fedora

On Fedora, you can use the dnf package manager:

sudo dnf install googler

Arch Linux

Arch Linux and its derivatives can use the pacman package manager:

sudo pacman -S googler

openSUSE

For openSUSE, you would use zypper:

sudo zypper install googler

CentOS

On CentOS, you’ll likely need to enable the EPEL repository first, then install:

sudo yum install epel-release
sudo yum install googler

Other distributions

If your distribution isn’t listed or you prefer compiling from source, you can always download the latest release from Googler’s GitHub page. This method requires a bit more effort but is generally straightforward. Just follow the instructions provided in the repository.

Post-installation check

Regardless of your distribution, it’s always a good idea to verify the installation. Simply type googler -v in your terminal. This command should return the version of Googler installed on your system, confirming that the installation was successful.

foss_linux@fosslinux-ubuntu:~$ googler -v
4.3.2
foss_linux@fosslinux-ubuntu:~$

Step 2: First search

Once installed, it’s as simple as typing googler followed by your search query. For example:

googler ubuntu

This command will return a list of search results related to Ubuntu, just like you’d expect from a Google search in your browser.

foss_linux@fosslinux-ubuntu:~$ googler ubuntu

1. Ubuntu: Enterprise Open Source and Linux
https://ubuntu.com/
Ubuntu is the modern, open source operating system on Linux for the
enterprise server, desktop, cloud, and IoT.

Navigating search results

Opening a link

To open a link in your web browser, simply type the corresponding number. For instance, 1 would open the first result in your default web browser.

foss_linux@fosslinux-ubuntu:~$ googler ubuntu

1. Ubuntu: Enterprise Open Source and Linux
https://ubuntu.com/
Ubuntu is the modern, open source operating system on Linux for the
enterprise server, desktop, cloud, and IoT.

googler (? for help) 1
googler (? for help)
opening url from terminal

Opening URL from Terminal

Advanced features

Limiting search results

You can limit the number of search results returned by using the -n flag. For instance, googler -n 3 fosslinux will return only 3 results.

Example output:

1. FOSS Linux - Enhance Your Linux Experience

https://fosslinux.com FOSS Linux publishes the latest news, tutorials, software reviews, and more about Linux and open-source applications. 2. About Us - FOSS Linux 

https://fosslinux.com/about-us Learn more about FOSS Linux, our mission, and what drives our content and tutorials about the Linux operating system. 3. Linux Tips and Tricks - FOSS Linux 

https://fosslinux.com/category/tips-tricks Discover various tips and tricks to enhance your Linux experience, covering a wide range of topics for different Linux distributions.

Searching specific sites

To search within a specific site, use the -w flag. For example, googler -w wikipedia.org quantum computing will return results from Wikipedia related to quantum computing.

googler -w wikipedia.org quantum computing
1. Quantum computing - Wikipedia
https://en.wikipedia.org/wiki/Quantum_computing
An overview of quantum computing, including its fundamental principles, how it differs from classical computing, and potential applications.

2. Quantum computer - Wikipedia
https://en.wikipedia.org/wiki/Quantum_computer
Detailed article on quantum computers, discussing their design, operation, types of quantum bits (qubits), and current technological challenges.

3. Timeline of quantum computing - Wikipedia
https://en.wikipedia.org/wiki/Timeline_of_quantum_computing
A timeline detailing significant milestones and developments in the field of quantum computing from the 1980s to the present.

4. Quantum algorithm - Wikipedia
https://en.wikipedia.org/wiki/Quantum_algorithm
Information on quantum algorithms, including famous examples like Shor's algorithm and Grover's algorithm, and their implications for computing.

5. Quantum supremacy - Wikipedia
https://en.wikipedia.org/wiki/Quantum_supremacy
An article on the concept of quantum supremacy, discussing the point at which quantum computers can solve problems that classical computers practically cannot.

The googler command provides a quick and efficient way to search specific websites like Wikipedia directly from the terminal, which can be particularly useful for research or quick information retrieval without leaving the command line environment.

Quick reference: Googler commands and their functions

This table provides a quick reference to some common and useful Googler commands. Each command has a specific purpose, making Googler a versatile tool for various search-related tasks directly from the terminal.

Googler command Use
googler <query> Basic search with <query>.
googler -n <number> <query> Limits the search to <number> of results.
googler -w <website> <query> Searches <query> only on <website>.
googler -c <country> <query> Performs the search as if you were in a specific <country>.
googler -l <number> Sets the default number of search results to <number>.
googler -t <time> Limits search results to the past <time> (e.g., y, m).
googler -x Opens the first result directly in the browser.
googler --json <query> Outputs the search results in JSON format.
googler -C Opens Googler in colorful mode.
googler --news <query> Searches for news articles related to <query>.
googler --proxy <http_proxy> Uses a specified HTTP proxy for searches.
googler -u <url> Opens a URL directly via Googler.
googler --version Displays the current version of Googler.
googler -h or googler --help Displays help information about Googler commands.

Discovering more with Googler: Using the manual page

One of the great things about command line tools like Googler is their flexibility and the range of options they offer. If you’re curious about what more Googler can do, the man (manual) command is your go-to resource. It provides detailed documentation on how to use Googler, including a comprehensive list of options and functionalities.

Accessing the Googler manual

To view the Googler manual page, simply enter the following command in your terminal:

man googler
GOOGLER(1) User Commands GOOGLER(1)

NAME
googler - Google from the command-line

SYNOPSIS
googler [OPTIONS] [KEYWORD [KEYWORD ...]]

DESCRIPTION
googler is a command-line tool to search Google (web, news, videos and
site search) from the terminal. Google site search works too. googler
shows the title, URL and text context for each result. Results are
fetched in pages. Next or previous page navigation is possible using
keyboard shortcuts. Results are indexed and a result URL can be opened
in a browser using the index number. There is no configuration file as
aliases serve the same purpose for this utility. Supports sequential
searches in a single instance.

Features

* Google Search, Google Site Search, Google News
* Fast and clean (no ads, stray URLs or clutter), custom color
* Navigate result pages from omniprompt, open URLs in browser
Manual page googler(1) line 1 (press h for help or q to quit)

------

This command will open the manual page for Googler in your terminal. Here, you’ll find a wealth of information, including:

  1. Synopsis: A brief overview of how the command is used, including its syntax.
  2. Description: A detailed description of what Googler is and its capabilities.
  3. Options: A list of all the options you can use with Googler, such as limiting search results, specifying time duration for searches, filtering results, etc.
  4. Examples: Practical examples of how to use Googler with various options.
  5. Files: Information about the configuration files, if any.
  6. See Also: References to related resources or commands.
  7. Authors: Credits to the people who developed Googler.

Navigating the manual page

While in the manual page, you can use your keyboard to navigate:

  • Enter/Return key: Scroll down line by line.
  • Spacebar: Scroll down a page at a time.
  • B key: Scroll up a page at a time.
  • Up/Down arrow keys: Scroll one line at a time.
  • Q key: Quit the manual page and return to the terminal.

I personally find diving into the manual pages of commands both enlightening and empowering. It’s like having a detailed guidebook at your fingertips, and it significantly enhances your understanding and usage of the tool. I encourage you to explore the man googler page, even if you’re just curious; you might discover a feature that could be a real time-saver in the future!

Uninstalling Googler

There might come a time when you no longer need Googler on your system. Maybe you’ve found an alternative tool, or you simply want to declutter your terminal applications. Whatever the reason, uninstalling Googler is straightforward. The process, however, can vary slightly depending on your Linux distribution.

Uninstalling on Debian-based distributions (like Ubuntu)

If you’re using a Debian-based distribution, you installed Googler using apt-get. To uninstall it, use the following command:

sudo apt-get remove googler

Uninstalling on Fedora

For Fedora users who installed Googler using dnf, the uninstallation command is:

sudo dnf remove googler

Uninstalling on Arch Linux

In Arch Linux, where pacman is the package manager, use:

sudo pacman -R googler

Uninstalling on openSUSE

For openSUSE, with zypper as the package manager:

sudo zypper remove googler

Uninstalling on CentOS

And if you’re a CentOS user and used yum for installation:

sudo yum remove googler

Manual uninstallation

If you installed Googler manually (perhaps from a downloaded script or compiling from source), the uninstallation process might involve manually removing the files you created. This could include deleting the executable file and any associated configuration files.

Cleaning up

After uninstallation, it’s a good practice to check if there are any residual configuration files left behind in your system. These files are usually in your home directory, under ~/.config/googler/ or similar paths. You can remove them if you don’t plan on reinstalling Googler.

Conclusion

Reflecting on our exploration of Googler, it’s clear that this tool is much more than a simple utility. It’s a testament to the versatility and power of the command line. From basic searches to accessing detailed manual pages, customizing search results, and even handling uninstallation, Googler proves its worth as an integral part of any tech-savvy individual’s toolkit.

Whether you’re delving into its advanced search options, navigating through its manual, or customizing it to fit your workflow, Googler stands out as an efficient and effective solution for terminal-based Google searches. It’s a classic example of how command line tools can simplify and enhance our digital lives, blending functionality with the elegance of simplicity.

You may also like

Leave a Comment

fl_logo_v3_footer

ENHANCE YOUR LINUX EXPERIENCE.



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY.

ALL RIGHTS RESERVED.

“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.