Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
DDGR(1)				 User Commands			       DDGR(1)

       ddgr - DuckDuckGo from the terminal

       ddgr [OPTIONS] [KEYWORD [KEYWORD	...]]

       ddgr is a command-line tool to search DuckDuckGo. ddgr shows the	title,
       URL and text context for	each result. Results  are  fetched  in	pages.
       Keyboard	 shortcuts  are	available for page navigation. Results are in-
       dexed and a result URL can be opened in a browser using the index  num-
       ber.  There  is no configuration	file as	aliases	serve the same purpose
       for this	utility. Supports sequential searches in a single instance.


	 * Fast	and clean; custom color
	 * Designed for	maximum	readability at minimum space
	 * Instant answers (supported by DDG html version)
	 * Custom number of results per	page
	 * Navigation, browser integration
	 * Search and option completion	scripts	(Bash, Fish, Zsh)
	 * DuckDuckGo Bangs (along with	completion)
	 * Open	the first result in browser (I'm Feeling Ducky)
	 * REPL	for continuous searches
	 * Keywords (e.g. `filetype:mime`, ``)
	 * Limit search	by time, specify region, disable safe search
	 * HTTPS proxy support,	optionally disable User	Agent
	 * Do Not Track	set by default
	 * Supports custom url handler script or cmdline utility
	 * Thoroughly documented, man page with	examples
	 * Minimal dependencies

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

       -n, --num=N
	      Show N results per page (default 10). N must be  between	0  and
	      25. N=0 disables fixed paging and	shows actual number of results
	      fetched per page.

       -r, --reg=REG
	      Region-specific search e.g.  'us-en'  for	 US  (default);	 visit

       -C, --nocolor
	      Disable color output.

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

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

       -t, --time=SPAN
	      Time limit search	[d=past	day, w=past week, m=past month,	y=past
	      year] (default=any time).

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

       -x, --expand
	      Expand URLs instead of showing only the domain name (default).

       -p, --proxy=URI
	      Tunnel traffic through  an  HTTP	proxy.	URI  is	 of  the  form
	      [http[s]://][user:pwd@]host[:port].  The	proxy server must sup-
	      port HTTP	CONNECT	tunneling and must not block port 443 for  the
	      relevant	DuckDuckGo  hosts. If a	proxy is not explicitly	given,
	      the https_proxy or HTTPS_PROXY environment variable  (if	avail-
	      able) is used instead.

	      Disable safe search.

       --noua Disable user agent. Results are fetched faster.

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

       --gb, --gui-browser
	      Open a bang directly in a	GUI browser.

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

	      Custom script or command-line utility to open urls with.

	      Do  not  suppress	browser	output when opening result in browser;
	      that is, connect stdout and stderr of the	browser	to ddgr's std-
	      out  and stderr instead of /dev/null. By default,	browser	output
	      is suppressed (due to certain graphical  browsers	 spewing  mes-
	      sages  to	 console) unless the BROWSER environment variable is a
	      known text-based browser:	 elinks,  links,  lynx,	 w3m  or  www-

       -v, --version
	      Show version number and exit.

       -d, --debug
	      Enable debugging.

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

       index  Open the result corresponding to index in	browser.

       o [index|range|a	...]
	      Open  space-separated  result indices, numeric ranges or all in-
	      dices, if	'a' is specified, in the browser.

       O [index|range|a	...]
	      Works similar  to	 key  'o',  but	 tries	to  ignore  text-based
	      browsers	(even  if  BROWSER  is	set)  and  open	links in a GUI

       d keywords
	      Initiate a new DuckDuckGo	search for keywords with original  op-
	      tions.  This  key	 should	be used	to search omniprompt keys (in-
	      cluding itself) and indices.

       x      Toggle url expansion.

       c index
	      Copy url to clipboard.

       q, ^D, double Enter
	      Exit ddgr.

       ?      Show omniprompt help.

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

       ddgr 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
       - 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

       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 oCdgxy, which stands for

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

       Note that

       - Bright	 colors	(implemented as	\x1b[90m - \x1b[97m) may not be	avail-
	 able 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 col-
	 ors via a default-off switch.

       Please  consult	the  manual  of	 your  terminal	 emulator  as  well as for details.

	      Overrides	the default browser.  Ref:

	      Refer to the COLORS section.

	      Force a plain omniprompt if you are facing issues	with colors at
	      the prompt.

       HTTPS_PROXY, https_proxy
	      Refer to the --proxy option.

       1.  DuckDuckGo hello world:

	      ddgr hello world

       2.  I'm Feeling Ducky search:

	      ddgr -j lucky ducks

       3.  DuckDuckGo Bang search 'hello world'	in Wikipedia:

	      ddgr !w hello world
	      ddgr \!w hello world // bash-specific, need to escape ! on bash

	   Bangs  work	at  the	 omniprompt  too.  To  look  up	 bangs,	 visit

       4.  Bang	 alias to fire from the	cmdline, open results in a GUI browser
	   and exit:

	      alias bang='ddgr --gb --np'

	      bang !w hello world
	      bang \!w hello world // bash-specific, need to escape ! on bash

       5.  Website specific search:

	      ddgr -w digital camera

	   Site	specific search	continues at omniprompt.

       6.  Search for a	specific file type:

	      ddgr instrumental	filetype:mp3

       7.  Fetch results on IPL	cricket	from India in English:

	      ddgr -r in-en IPL	cricket

	   To  find  your   region   parameter	 token	 visit	 https://duck-

       8.  Search quoted text:

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

       9.  Show	complete urls in search	results	(instead of only domain	name):

	      ddgr -x ddgr

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

	      ddgr --colors bjdxxy hello world

	      DDGR_COLORS=bjdxxy ddgr hello world

       11. Tunnel traffic through an HTTPS proxy, e.g.,	a  local  Privoxy  in-
	   stance listening on port 8118:

	      ddgr --proxy localhost:8118 hello	world

	   By default the environment variable https_proxy (or HTTPS_PROXY) is
	   used, if defined.

       12. Look	up n, p, o, O, q, d keywords or	a  result  index  at  the  om-
	   niprompt:  as the omniprompt	recognizes these keys or index strings
	   as commands,	you need to prefix them	with d,	e.g.,

	      d	n
	      d	d keywords
	      d	1

       Arun Prakash Jana <>



       Copyright (C) 2016-2020 Arun Prakash Jana <>

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

Version	1.9			  21 Jul 2020			       DDGR(1)


Want to link to this manual page? Use this URL:

home | help