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.

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

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

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:

-n num – tells googler to display at most 8 results per a page (default is 10).

-w – enables Google site(tecmint.com) search.

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

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

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.

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.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

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.

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.

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