GOOGLER(1)

NAME
googler - Google from the command-line

SYNOPSIS
<<<<<<< b2cdffaa40b951182d18c5a0e4c94cf8c291ee0b googler [OPTIONS] [KEYWORD [KEYWORD ...]] ======= googler [-s N] [-n N] [-N] [-c TLD] [-l LANG] [-x] [-C]
        [-j] [-t dN] [-w SITE] [-d] KEYWORD [KEYWORD ...] >>>>>>> HEAD~0

DESCRIPTION
googler is a command-line tool to search Google (Web & News) 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.

OPTIONS

-h, --help
    Show help text and exit.

-s, --start=N
    Start at the Nth result.

-n, --count=N
    Show N results (default 10).

-N, --news
    Show results from news section.

-c, --tld=TLD
    Country-specific search with top-level domain .TLD, e.g., in for India (refer https://en.wikipedia.org/wiki/List_of_Google_domains for a full list of TLDs).

-l, --lang=LANG
    Search for the language LANG, e.g., fi for Finnish.

-x, --exact
    Disable automatic spelling correction. Search exact keywords.

-C, --nocolor
    Disable color output.

--colors=COLORS
    Set output colors. Refer to the COLORS section below for details.

-j, --first, --lucky
    Open the first result in a web browser; implies --noprompt. Feeling Lucky?

-t, --time=dN
    Time limit search [h5 (5 hrs), d5 (5 days), w5 (5 weeks), m5 (5 months), y5 (5 years)].

-w, --site=SITE
    Search a site using Google.

-p, --proxy=PROXY
    Tunnel traffic through an HTTPS proxy. PROXY is of the form HOST:PORT. The proxy server must support HTTP CONNECT tunneling and must not block port 443 for the relevant Google hosts.

--json
    Output in JSON format; implies --noprompt.

--np, --noprompt
    Perform search and exit; do not prompt for further interactions.

-d, --debug
    Enable debugging.

OMNIPROMPT KEYS

n, p
    Fetch the next or previous set of search results.

index
    Open the result corresponding to index in browser.

f   Jump to the first page.

o   Open the current search in browser.

g keywords
    Initiate a new Google search for keywords with original options.

q, ^D, double Enter
    Exit googler.

?   Show omniprompt help.

*   Any other string initiates a new search with original options.

COLORS
googler allows you to customize the color scheme via a six-letter string, reminiscent of BSD LSCOLORS. The six letters represent the colors of

-   indices
-   titles
-   URLs
-   metadata/publishing info (Google News only)
-   abstracts
-   prompts

respectively. The six-letter string is passed in either as the argument to the --colors option, or as the value of the environment variable GOOGLER_COLORS.

We offer the following colors/styles:
    Letter | Color/Style
    a | black
    b | red
    c | green
    d | yellow
    e | blue
    f | magenta
    g | cyan
    h | white
    i | bright black
    j | bright red
    k | bright green
    l | bright yellow
    m | bright blue
    n | bright magenta
    o | bright cyan
    p | bright white
    A-H | bold version of the lowercase-letter color
    I-P | bold version of the lowercase-letter bright color
    x | normal
    X | bold
    y | reverse video
    Y | bold reverse video

The default colors string is GKlgxy, which stands for

-   bold bright cyan indices
-   bold bright green titles
-   bright yellow URLs
-   cyan metadata/publishing info
-   normal abstracts
-   reverse video prompts

Note that

-   Bright colors (implemented as \x1b[90m - \x1b[97m) may not be available in all color-capable terminal emulators;

-   Some terminal emulators draw bold text in bright colors instead;

-   Some terminal emulators only distinguish between bold and bright colors via a default-off switch.

Please consult the manual of your terminal emulator as well as https://en.wikipedia.org/wiki/ANSI_escape_code for details.

ENVIRONMENT

BROWSER
    Overrides the default browser. Ref: http://docs.python.org/library/webbrowser.html

GOOGLER_COLORS
    Refer to the COLORS section.

EXAMPLES

1.  Google hello world:

    googler hello world

2.  Fetch 15 results updated within last 14 months, starting from the 3rd result for the string cmdline utility in site tuxdiary.com:

    googler -n 15 -s 3 -t m14 -w tuxdiary.com cmdline utility

3.  Read recent news on gadgets:

    googler -N gadgets

4.  Fetch results on IPL cricket from Google India server in English:

    googler -c in -l en IPL cricket

5.  Search quoted text e.g. it's a "beautiful world" in spring:

    googler it\'s a \"beautiful world\" in spring

6.  Search for a specific file type:

    googler instrumental filetype:mp3

7.  Disable automatic spelling correction, e.g. fetch results for googler instead of google:

    googler -x googler

8.  I'm feeling lucky search:

    googler -j leather jackets

9.  Website specific search:

    googler -w tuxdiary.com hello world

    Site specific search continues at omniprompt. Use the g key to run a regular Google search.

10. Alias to find definitions of words:

    alias define='googler -n 2 define'

11. Look up n, p, o, q, g keywords or a result index at the omniprompt: As the omniprompt recognizes n, p, o, q, g or index strings as commands, you need to prefix them with g, e.g.,

    g n
    g g keywords
    g 1

12. Input and output redirection:

    googler -C hello world < input > output

    Note that -C is required to avoid printing control characters (for colored output).

13. Pipe output:

    googler -C hello world | tee output

14. Use a custom color scheme, e.g., one warm color scheme designed for Solarized Dark:

    googler --colors bjdxxy google

    GOOGLER_COLORS=bjdxxy googler google

15. Tunnel traffic through an HTTPS proxy, e.g., a local Privoxy instance listening on port 8118:

    googler --proxy localhost:8118 google

AUTHORS
Henri Hakkinen
Arun Prakash Jana <engineerarun@gmail.com>
Zhiming Wang <zmwangx@gmail.com>

HOME
https://github.com/jarun/googler

REPORTING BUGS
https://github.com/jarun/googler/issues

LICENSE
Copyright © 2008 Henri Hakkinen
Copyright © 2015-2016 Arun Prakash Jana <engineerarun@gmail.com>

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.