1DDGR(1) User Commands DDGR(1)
2
3
4
6 ddgr - DuckDuckGo from the terminal
7
9 ddgr [OPTIONS] [KEYWORD [KEYWORD ...]]
10
12 ddgr is a command-line tool to search DuckDuckGo. ddgr shows the title,
13 URL and text context for each result. Results are fetched in pages.
14 Keyboard shortcuts are available for page navigation. Results are
15 indexed and a result URL can be opened in a browser using the index
16 number. There is no configuration file as aliases serve the same pur‐
17 pose for this utility. Supports sequential searches in a single
18 instance.
19
20 Features
21
22 * Fast and clean; custom color
23 * Designed for maximum readability at minimum space
24 * Instant answers (supported by DDG html version)
25 * Custom number of results per page
26 * Navigation, browser integration
27 * Search and option completion scripts (Bash, Fish, Zsh)
28 * DuckDuckGo Bangs (along with completion)
29 * Open the first result in browser (I'm Feeling Ducky)
30 * REPL for continuous searches
31 * Keywords (e.g. `filetype:mime`, `site:somesite.com`)
32 * Limit search by time, specify region, disable safe search
33 * HTTPS proxy support, optionally disable User Agent
34 * Do Not Track set by default
35 * Supports custom url handler script or cmdline utility
36 * Thoroughly documented, man page with examples
37 * Minimal dependencies
38
40 -h, --help
41 Show help text and exit.
42
43 -n, --num=N
44 Show N results per page (default 10). N must be between 0 and
45 25. N=0 disables fixed paging and shows actual number of results
46 fetched per page.
47
48 -r, --reg=REG
49 Region-specific search e.g. 'us-en' for US (default); visit
50 https://duckduckgo.com/params.
51
52 -C, --nocolor
53 Disable color output.
54
55 --colors=COLORS
56 Set output colors. Refer to the COLORS section below for
57 details.
58
59 -j, --ducky
60 Open the first result in a web browser; implies --noprompt.
61 Feeling Ducky?
62
63 -t, --time=SPAN
64 Time limit search [d=past day, w=past week, m=past month]
65 (default=any time).
66
67 -w, --site=SITE
68 Search a site using DuckDuckGo.
69
70 -x, --expand
71 Expand URLs instead of showing only the domain name (default).
72
73 -p, --proxy=URI
74 Tunnel traffic through an HTTP proxy. URI is of the form
75 [http[s]://][user:pwd@]host[:port]. The proxy server must sup‐
76 port HTTP CONNECT tunneling and must not block port 443 for the
77 relevant DuckDuckGo hosts. If a proxy is not explicitly given,
78 the https_proxy or HTTPS_PROXY environment variable (if avail‐
79 able) is used instead.
80
81 --unsafe
82 Disable safe search.
83
84 --noua Disable user agent. Results are fetched faster.
85
86 --json Output in JSON format; implies --noprompt.
87
88 --gb, --gui-browser
89 Open a bang directly in a GUI browser.
90
91 --np, --noprompt
92 Perform search and exit; do not prompt for further interactions.
93
94 --url-handler=UTIL
95 Custom script or command-line utility to open urls with.
96
97 --show-browser-logs
98 Do not suppress browser output when opening result in browser;
99 that is, connect stdout and stderr of the browser to ddgr's std‐
100 out and stderr instead of /dev/null. By default, browser output
101 is suppressed (due to certain graphical browsers spewing mes‐
102 sages to console) unless the BROWSER environment variable is a
103 known text-based browser: elinks, links, lynx, w3m or www-
104 browser.
105
106 -v, --version
107 Show version number and exit.
108
109 -d, --debug
110 Enable debugging.
111
113 n, p, f
114 Fetch the next, previous or first set of search results.
115
116 index Open the result corresponding to index in browser.
117
118 o [index|range|a ...]
119 Open space-separated result indices, numeric ranges or all
120 indices, if 'a' is specified, in the browser.
121
122 O [index|range|a ...]
123 Works similar to key 'o', but tries to ignore text-based
124 browsers (even if BROWSER is set) and open links in a GUI
125 browser.
126
127 d keywords
128 Initiate a new DuckDuckGo search for keywords with original
129 options. This key should be used to search omniprompt keys
130 (including itself) and indices.
131
132 x Toggle url expansion.
133
134 c index
135 Copy url to clipboard.
136
137 q, ^D, double Enter
138 Exit ddgr.
139
140 ? Show omniprompt help.
141
142 * Any other string initiates a new search with original options.
143
145 ddgr allows you to customize the color scheme via a six-letter string,
146 reminiscent of BSD LSCOLORS. The six letters represent the colors of
147
148 - indices
149 - titles
150 - URLs
151 - metadata/publishing info
152 - abstracts
153 - prompts
154
155 respectively. The six-letter string is passed in either as the argument
156 to the --colors option, or as the value of the environment variable
157 DDGR_COLORS.
158
159 We offer the following colors/styles:
160
161 ┌───────┬───────────────────────────────────────────────────┐
162 │Letter │ Color/Style │
163 ├───────├───────────────────────────────────────────────────┤
164 │a │ black │
165 │b │ red │
166 │c │ green │
167 │d │ yellow │
168 │e │ blue │
169 │f │ magenta │
170 │g │ cyan │
171 │h │ white │
172 │i │ bright black │
173 │j │ bright red │
174 │k │ bright green │
175 │l │ bright yellow │
176 │m │ bright blue │
177 │n │ bright magenta │
178 │o │ bright cyan │
179 │p │ bright white │
180 │A-H │ bold version of the lowercase-letter color │
181 │I-P │ bold version of the lowercase-letter bright color │
182 │x │ normal │
183 │X │ bold │
184 │y │ reverse video │
185 │Y │ bold reverse video │
186 └───────┴───────────────────────────────────────────────────┘
187
188 The default colors string is oCdgxy, which stands for
189
190 - bright cyan indices
191 - bold green titles
192 - yellow URLs
193 - cyan metadata/publishing info
194 - normal abstracts
195 - reverse video prompts
196
197 Note that
198
199 - Bright colors (implemented as \x1b[90m - \x1b[97m) may not be
200 available in all color-capable terminal emulators;
201
202 - Some terminal emulators draw bold text in bright colors
203 instead;
204
205 - Some terminal emulators only distinguish between bold and
206 bright colors via a default-off switch.
207
208 Please consult the manual of your terminal emulator as well as
209 https://en.wikipedia.org/wiki/ANSI_escape_code for details.
210
212 BROWSER
213 Overrides the default browser. Ref:
214 http://docs.python.org/library/webbrowser.html
215
216 DDGR_COLORS
217 Refer to the COLORS section.
218
219 DISABLE_PROMPT_COLOR
220 Force a plain omniprompt if you are facing issues with
221 colors at the prompt.
222
223 HTTPS_PROXY, https_proxy
224 Refer to the --proxy option.
225
227 1. DuckDuckGo hello world:
228
229 ddgr hello world
230
231 2. I'm Feeling Ducky search:
232
233 ddgr -j lucky ducks
234
235 3. DuckDuckGo Bang search 'hello world' in Wikipedia:
236
237 ddgr !w hello world
238 ddgr \!w hello world // bash-specific, need to escape ! on bash
239
240 Bangs work at the omniprompt too. To look up bangs, visit
241 https://duckduckgo.com/bang?#bangs-list.
242
243 4. Bang alias to fire from the cmdline, open results in a GUI
244 browser and exit:
245
246 alias bang='ddgr --gb --np'
247
248 bang !w hello world
249 bang \!w hello world // bash-specific, need to escape ! on bash
250
251 5. Website specific search:
252
253 ddgr -w amazon.com digital camera
254
255 Site specific search continues at omniprompt.
256
257 6. Search for a specific file type:
258
259 ddgr instrumental filetype:mp3
260
261 7. Fetch results on IPL cricket from India in English:
262
263 ddgr -r in-en IPL cricket
264
265 To find your region parameter token visit https://duck‐
266 duckgo.com/params.
267
268 8. Search quoted text:
269
270 ddgr it\'s a \"beautiful world\" in spring
271
272 9. Show complete urls in search results (instead of only domain
273 name):
274
275 ddgr -x ddgr
276
277 10. Use a custom color scheme, e.g., one warm color scheme
278 designed for Solarized Dark:
279
280 ddgr --colors bjdxxy hello world
281
282 DDGR_COLORS=bjdxxy ddgr hello world
283
284 11. Tunnel traffic through an HTTPS proxy, e.g., a local Privoxy
285 instance listening on port 8118:
286
287 ddgr --proxy localhost:8118 hello world
288
289 By default the environment variable https_proxy (or
290 HTTPS_PROXY) is used, if defined.
291
292 12. Look up n, p, o, O, q, d keywords or a result index at the
293 omniprompt: as the omniprompt recognizes these keys or index
294 strings as commands, you need to prefix them with d, e.g.,
295
296 d n
297 d d keywords
298 d 1
299
301 Arun Prakash Jana <engineerarun@gmail.com>
302
304 https://github.com/jarun/ddgr
305
307 https://github.com/jarun/ddgr/issues
308
310 Copyright © 2016-2019 Arun Prakash Jana <engineerarun@gmail.com>
311
312 License GPLv3+: GNU GPL version 3 or later
313 <http://gnu.org/licenses/gpl.html>.
314 This is free software: you are free to change and redistribute
315 it. There is NO WARRANTY, to the extent permitted by law.
316
317
318
319Version 1.6 16 Nov 2018 DDGR(1)