How To Search Google from the Command Line

手机数码 2017-08-18

Ever had a hankering to search Google from the command line? If so, you’re going to love this nifty terminal tool.

It’s called Googler and, as you can probably guess, it’s a small command-line utility which lets you search Google from the terminal.

You’re not limited to regular Google web search either as the python-based tool lets you use Google site search and probe Google News for content that matches your chosen query(s).

As a search tool the way search results are presented is important — and thankfully it really delivers.

When you search from the command-line using Googler you’re presented with a list of search results that show the title, URL and a short text snippet. You can quickly open any result in a web browser by entering the number that corresponds to the result you want to read.

A stack of other search options and parameters are available for more advanced users. These let you search for an exact phrase, search a specific version or Google, and/or narrow down search results based on a specific time period.

Now, I’m not for one moment suggesting that Googler (or command line search in general) is the most practical way to find stuff on the web. It’s not. But it is novel, inventive, and, for those who spend a lot of time staring down a blinking underscore at the command line, potentially handy in a pinch.

Googler Lets You Search Google from the Terminal

Googler was created to let people make web searches on a headless server lacking an X session, where it could integrate neatly with a text-based browser. In such situations it provides a fully immersive command-line web search experience.

But the inherent niftiness of the tool, combined with the novelty of being able to Google from the terminal, has seen it pick up an army of admirers on the regular desktop too — and a boat load of new features to boot.

You can limit the number of results; define an alias to perform site searches (e.g., omgubuntu plank themes ; use a specific locale version; and, well, a bunch more besides!

I must stress that Googler is not affiliated, endorsed or supported by Google itself. It’s an unofficial, unrelated, third-party project. It is open-source. Code is available on Github.

Install Googler on Ubuntu

It’s really easy to install Googler on Ubuntu. Just click this button to install it from Ubuntu Software:

Click to install Googler on Ubuntu

Or, from the command line, run:

sudo apt install googler

Once installed Googler is immediately available ready to use. Simply pop open your favourite terminal emulator and punch in the single command:


Googler will then prompt you to enter a search query. Quickly type a phrase or two and hit the return key. The app will print a list of matching results.

Google Command Line Search Options

Googler may be effortlessly simple to use, but for the times you need more finesse and control over search results there are a stack of options ready to assist.

You can type googler --help to see a full list of available arguments, options, and flags. Or, if you’re lazy, you can see them in this image:

The ones I find most useful are --count and --time which (shock) lets you limit how many search results you see, and the time period from which they’re chosen.

So, for example, I I want to see the top 4 results about hamsters, limited to things published in the last 5 hours, I run:

googler --count 4 --time h5 hamsters

Simple enough, isn’t it?!

Got a top terminal tool you think we should write about? Stuff a link and some info in our mailbox and we’ll check it out.


一线 | 谷歌投资京东:在亚太区以搜索流量促交易... 腾讯《一线》 纪振宇 6月18日发自硅谷 在国内欢度端午节之际,一则新闻在科技圈内刷屏:谷歌5.5亿美元投资京东。于是,关于谷歌如何通过投资京东,牵制亚马逊,同时京东通过和谷歌的合作,增强与阿里抗衡的实力等解读迅速流行开来。 但这则新闻,或许远没有重大到这样的程度。从谷歌方面来看,这则消...
用这 7 类应用,帮助你过上高效的学习生活... 正处 3 月,想必学生朋友们已经在新学期里度过了一段时间。在这之中,有没有人为期末考试不理想的成绩感到沮丧,有没有人为自己过去的一学期里没有认真学习的行为感到后悔。其实这都不重要,新学期收拾好心情,重新投入学习才最关键。 俗话说,工欲善其事,必先利其器。想让成绩走出低谷的话,你就要践行一天天有效...
互联网广告CPM,CPC,CPA的魔咒和圣杯 作者:欧阳辰 互联网广告是一门技术和业务结合的很美妙的行业: 绚烂的技术未必能带来业务增长,朴素的业务后面可能有高深的技术。 计费(Pricing)模式是其中一个核心的难题,计费模式包括CPM,CPC,CPL(Lead),CPI(安装),CPS(销售)等等。每一种模式都是 广告平台,媒...
Apple switches default from Bing to Google for Sir... “Apple is switching the default provider of its web searches from Siri, Search inside iOS (formerly called Spotlight) and Spotlight on the Mac,” Matth...
我喜欢的3个搜图网站 首先关于互联网图片资源,我们有一个问题: 「网络上那么多图片,难道都是不能免费用的吗?」 答案很明显,大部分是不能免费使用的。 我们平时在Google、百度搜索的,在各种网站、社交平台上获取到的绝大部分图片,严格追溯起来的话,其实大多都是有版权,且不能随意使用的,尤其是将它们用...