1GOOGLER(1)                       User Commands                      GOOGLER(1)
2
3
4

NAME

6       googler - Google from the command-line
7

SYNOPSIS

9       googler [OPTIONS] [KEYWORD [KEYWORD ...]]
10

DESCRIPTION

12       googler  is a command-line tool to search Google (web, news, videos and
13       site search) from the terminal. Google site search works  too.  googler
14       shows  the  title,  URL  and  text context for each result. Results are
15       fetched in pages. Next or previous page navigation  is  possible  using
16       keyboard  shortcuts. Results are indexed and a result URL can be opened
17       in a browser using the index number. There is no configuration file  as
18       aliases  serve  the  same purpose for this utility. Supports sequential
19       searches in a single instance.
20
21       Features
22
23         * Google Search, Google Site Search, Google News
24         * Fast and clean (no ads, stray URLs or clutter), custom color
25         * Navigate result pages from omniprompt, open URLs in browser
26         * Effortless keyword-based site search with googler @t add-on
27         * Search and option completion scripts for Bash, Zsh and Fish
28         * Fetch n results in a go, start at the n<sup>th</sup> result
29         * Disable automatic spelling correction and search exact keywords
30         * Specify duration, country/domain  (default:  worldwide/.com),  lan‐
31       guage
32         * Google keywords (e.g. filetype:mime, site:somesite.com) support
33         * Open the first result directly in browser (as in I'm Feeling Lucky)
34         * Non-stop searches: fire new searches at omniprompt without exiting
35         * HTTPS proxy, User Agent, TLS 1.2 (default) support
36         * Comprehensive documentation, man page with handy usage examples
37         * Minimal dependencies
38

OPTIONS

40       -h, --help
41              Show help text and exit.
42
43       -s, --start=N
44              Start at the Nth result.
45
46       -n, --count=N
47              Show N results (default 10).
48
49       -N, --news
50              Show results from news section.
51
52       -c, --tld=TLD
53              Country-specific search with top-level domain .TLD, e.g., in for
54              India.
55
56       -l, --lang=LANG
57              Search for the language LANG, e.g., fi for Finnish.
58
59       -g, --geoloc=CC
60              Country-specific geolocation search with country code  CC,  e.g.
61              'in' for India. Country codes are the same as top-level domains.
62
63       -x, --exact
64              Disable automatic spelling correction. Search exact keywords.
65
66       -C, --nocolor
67              Disable color output.
68
69       --colors=COLORS
70              Set  output  colors.  Refer  to  the  COLORS  section  below for
71              details.
72
73       -j, --first, --lucky
74              Open the first result in  a  web  browser;  implies  --noprompt.
75              Feeling Lucky?
76
77       -t, --time=dN
78              Time  limit search [h5 (5 hrs), d5 (5 days), w5 (5 weeks), m5 (5
79              months), y5 (5 years)].
80
81       -w, --site=SITE
82              Search a site using Google.
83
84       -e, --exclude=EXCLUDE
85              Exclude site from results.
86
87       --unfilter
88              Do not omit similar results.
89
90       -p, --proxy=PROXY
91              Tunnel traffic through an HTTP  proxy.  PROXY  is  of  the  form
92              [http://][user:password@]proxyhost[:port]. The proxy server must
93              support HTTP CONNECT tunneling and must not block port  443  for
94              the  relevant  Google hosts. If a proxy is not explicitly given,
95              the https_proxy environment  variable  (if  available)  is  used
96              instead.
97
98       --noua Disable user agent. Results are fetched faster.
99
100       --notweak
101              Disable  TCP  optimizations.  Negotiate Transport Layer Security
102              protocol instead of forcing TLS 1.2 (on Python 3.4  and  above).
103              Should be used only in case of connection issues.
104
105       --json Output in JSON format; implies --noprompt.
106
107       --url-handler=UTIL
108              Custom script or command-line utility to open urls with.
109
110       --show-browser-logs
111              Do  not  suppress browser output when opening result in browser;
112              that is, connect stdout and stderr of the browser  to  googler's
113              stdout and stderr instead of /dev/null. By default, browser out‐
114              put is suppressed (due to  certain  graphical  browsers  spewing
115              messages  to console) unless the BROWSER environment variable is
116              a known text-based browser: elinks, links,  lynx,  w3m  or  www-
117              browser.
118
119       --np, --noprompt
120              Perform search and exit; do not prompt for further interactions.
121
122       -u, --upgrade
123              Perform  in-place  self-upgrade.  By  default, the latest stable
124              version is used. However, the latest git master is used  instead
125              if  --include-git is also supplied. This mechanism is not avail‐
126              able on Windows (including Cygwin), and if you installed googler
127              with a package manager, this mechanism may have been disabled by
128              your packager at packaging or install time.
129
130       --include-git
131              See --upgrade.
132
133       -v, --version
134              Show version number and exit.
135
136       -d, --debug
137              Enable debugging.
138

OMNIPROMPT KEYS

140       n, p   Fetch the next or previous set of search results.
141
142       index  Open the result corresponding to index in browser.
143
144       f      Jump to the first page.
145
146       o [index|range|a ...]
147              Open space-separated result indices, numeric  ranges  (sitelinks
148              unsupported  in  ranges) or all indices, if 'a' is specified, in
149              the browser. Open the current search in the browser, if no argu‐
150              ments.
151
152       O [index|range|a ...]
153              Works  similar  to  key  'o',  but  tries  to  ignore text-based
154              browsers (even if BROWSER is  set)  and  open  links  in  a  GUI
155              browser.
156
157       g keywords
158              Initiate a new Google search for keywords with original options.
159              This key should be used to  search  omniprompt  keys  (including
160              itself) and indices.
161
162       c index
163              Copy url to clipboard.
164
165       u      Toggle url expansion.
166
167       q, ^D, double Enter
168              Exit googler.
169
170       ?      Show omniprompt help.
171
172       *      Any other string initiates a new search with original options.
173

GOOGLER @T

175       googler  @t  is  a  convenient add-on to Google Site Search with unique
176       keywords. While googler has an integrated option to search a  site,  it
177       could   be   simplified  further  with  aliases.  The  file  googler_at
178       (https://github.com/jarun/googler/blob/master/auto-comple
179       tion/googler_at/googler_at)  contains a list of website search aliases.
180       To source it, run:
181
182           source googler_at
183
184       or
185
186           . googler_at
187
188       With googler @t, the following command searches Wikipedia for hexspeak:
189
190           @w hexspeak
191
192       Other googler options can be combined. The shell can be  configured  to
193       be source the file at start-up for further convenience.
194
195       All the aliases start with the @ symbol (hence the name googler @t) and
196       there is minimum chance they will conflict  with  any  shell  commands.
197       Users can add new aliases to the file.
198

COLORS

200       googler  allows  you  to  customize  the  color scheme via a six-letter
201       string, reminiscent of BSD LSCOLORS. The six letters represent the col‐
202       ors of
203
204       - indices
205       - titles
206       - URLs
207       - metadata/publishing info (Google News only)
208       - abstracts
209       - prompts
210
211       respectively. The six-letter string is passed in either as the argument
212       to the --colors option, or as the value  of  the  environment  variable
213       GOOGLER_COLORS.
214
215       We offer the following colors/styles:
216
217         ┌───────┬───────────────────────────────────────────────────┐
218         │Letter │ Color/Style                                       │
219         ├───────├───────────────────────────────────────────────────┤
220         │a      │ black                                             │
221         │b      │ red                                               │
222         │c      │ green                                             │
223         │d      │ yellow                                            │
224         │e      │ blue                                              │
225         │f      │ magenta                                           │
226         │g      │ cyan                                              │
227         │h      │ white                                             │
228         │i      │ bright black                                      │
229         │j      │ bright red                                        │
230         │k      │ bright green                                      │
231         │l      │ bright yellow                                     │
232         │m      │ bright blue                                       │
233         │n      │ bright magenta                                    │
234         │o      │ bright cyan                                       │
235         │p      │ bright white                                      │
236         │A-H    │ bold version of the lowercase-letter color        │
237         │I-P    │ bold version of the lowercase-letter bright color │
238         │x      │ normal                                            │
239         │X      │ bold                                              │
240         │y      │ reverse video                                     │
241         │Y      │ bold reverse video                                │
242         └───────┴───────────────────────────────────────────────────┘
243
244       The default colors string is GKlgxy, which stands for
245
246       - bold bright cyan indices
247       - bold bright green titles
248       - bright yellow URLs
249       - cyan metadata/publishing info
250       - normal abstracts
251       - reverse video prompts
252
253       Note that
254
255       - Bright  colors (implemented as \x1b[90m - \x1b[97m) may not be avail‐
256         able in all color-capable terminal emulators;
257
258       - Some terminal emulators draw bold text in bright colors instead;
259
260       - Some terminal emulators only distinguish between bold and bright col‐
261         ors via a default-off switch.
262
263       Please  consult  the  manual  of  your  terminal  emulator  as  well as
264       https://en.wikipedia.org/wiki/ANSI_escape_code for details.
265

ENVIRONMENT

267       BROWSER
268              Overrides        the        default        browser.         Ref:
269              http://docs.python.org/library/webbrowser.html
270
271       GOOGLER_COLORS
272              Refer to the COLORS section.
273
274       DISABLE_PROMPT_COLOR
275              Force a plain omniprompt if you are facing issues with colors at
276              the prompt.
277
278       https_proxy
279              Refer to the --proxy option.
280
281       DISABLE_URL_EXPANSION
282              Show the domain names in search results instead of the  expanded
283              URL.
284

EXAMPLES

286       1.  Google hello world:
287
288              googler hello world
289
290       2.  Fetch  15  results updated within the last 14 months, starting from
291           the 3rd result for the keywords jungle book in site imdb.com:
292
293              googler -n 15 -s 3 -t m14 -w imdb.com jungle book
294
295       3.  Read recent news on gadgets:
296
297              googler -N gadgets
298
299       4.  Fetch results on IPL cricket from Google India server in English:
300
301              googler -c in -l en IPL cricket
302
303       5.  Search quoted text:
304
305              googler it\'s a \"beautiful world\" in spring
306
307       6.  Search for a specific file type:
308
309              googler instrumental filetype:mp3
310
311       7.  Disable automatic  spelling  correction,  e.g.  fetch  results  for
312           googler instead of google:
313
314              googler -x googler
315
316       8.  I'm feeling lucky search:
317
318              googler -j leather jackets
319
320       9.  Website specific search:
321
322              googler -w amazon.com -w ebay.com digital camera
323
324           Site specific search continues at omniprompt.
325
326       10. Alias to find definitions of words:
327
328              alias define='googler -n 2 define'
329
330       11. Look  up  n,  p,  o,  O,  q,  g  keywords  or a result index at the
331           omniprompt: as  the  omniprompt  recognizes  these  keys  or  index
332           strings as commands, you need to prefix them with g, e.g.,
333
334              g n
335              g g keywords
336              g 1
337
338       12. Input and output redirection:
339
340              googler -C hello world < input > output
341
342           Note  that -C is required to avoid printing control characters (for
343           colored output).
344
345       13. Pipe output:
346
347              googler -C hello world | tee output
348
349       14. Use a custom color scheme, e.g., one warm color scheme designed for
350           Solarized Dark:
351
352              googler --colors bjdxxy google
353
354              GOOGLER_COLORS=bjdxxy googler google
355
356       15. Tunnel  traffic  through  an  HTTPS  proxy,  e.g.,  a local Privoxy
357           instance listening on port 8118:
358
359              googler --proxy localhost:8118 google
360
361           By  default  the  environment  variable  https_proxy  is  used,  if
362           defined.
363
364       16. Quote  multiple  search keywords to auto-complete (using completion
365           script):
366
367              googler 'hello w<TAB>
368

AUTHORS

370       Henri Hakkinen
371       Arun Prakash Jana <engineerarun@gmail.com>
372       Zhiming Wang <zmwangx@gmail.com>
373

HOME

375       https://github.com/jarun/googler
376

REPORTING BUGS

378       https://github.com/jarun/googler/issues
379

LICENSE

381       Copyright © 2008 Henri Hakkinen
382       Copyright © 2015-2021 Arun Prakash Jana <engineerarun@gmail.com>
383
384       License     GPLv3+:     GNU     GPL     version     3     or      later
385       <http://gnu.org/licenses/gpl.html>.
386       This  is  free  software:  you  are free to change and redistribute it.
387       There is NO WARRANTY, to the extent permitted by law.
388
389
390
391Version 4.3.2                     21 Jan 2021                       GOOGLER(1)
Impressum