LinuxCommandLibrary

ddgr

DuckDuckGo search from the command line

TLDR

Search DuckDuckGo from the terminal

$ ddgr [search terms]
copy
Open the first result directly in browser (I'm Feeling Ducky)
$ ddgr -j [search terms]
copy
Search a specific website
$ ddgr -w [amazon.com] [digital camera]
copy
Limit search to recent results (d=day, w=week, m=month, y=year)
$ ddgr -t [w] [search terms]
copy
Set number of results per page
$ ddgr -n [25] [search terms]
copy
Use a DuckDuckGo bang shortcut
$ ddgr ![w] [wikipedia search]
copy
Output results as JSON
$ ddgr --json [search terms]
copy
Search through a proxy
$ ddgr --proxy [localhost:8118] [search terms]
copy

SYNOPSIS

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

DESCRIPTION

ddgr is a command-line tool for searching DuckDuckGo from the terminal. It displays search results with title, URL, and text context. Results are paginated and indexed, allowing quick navigation and opening in a browser by number.
The tool supports DuckDuckGo bangs (shortcuts like !w for Wikipedia, !yt for YouTube) and keywords like filetype: and site:. Results can be limited by time period or region. DuckDuckGo's privacy-focused approach means no tracking, and ddgr works over the Tor network.

PARAMETERS

-n, --num=N

Show N results per page (0-25, default: 10).
-r, --reg=REG
Region-specific search (e.g., us-en, uk-en, in-en).
-j, --ducky
Open first result in browser; implies --noprompt.
-t, --time=SPAN
Limit search by time: d (day), w (week), m (month), y (year).
-w, --site=SITE
Search a specific website.
-x, --expand
Show complete URLs instead of just domains.
-p, --proxy=URI
Route traffic through HTTP proxy.
--unsafe
Disable safe search.
--json
Output results as JSON; implies --noprompt.
--np, --noprompt
Search and exit without interactive prompt.
--colors=COLORS
Set custom output color scheme.
-C, --nocolor
Disable colored output.
-h, --help
Display help and exit.

CONFIGURATION

~/.config/ddgr/config

Configuration file for setting default options like number of results, region, and proxy settings.

OMNIPROMPT

n, p, f

Navigate to next, previous, or first page.
index
Open result number in browser.
o [index|range|a]
Open result(s) in browser.
d keywords
Perform new search with same options.
c index
Copy URL to clipboard.
x
Toggle URL expansion.
q, ^D, double Enter
Exit ddgr.

ENVIRONMENT

BROWSER

Override the default web browser.
DDGR_COLORS
Custom color scheme (six-letter string like BSD LSCOLORS).
HTTPS_PROXY
HTTP proxy configuration.

CAVEATS

Requires Python 3.8 or later. Results depend on DuckDuckGo's HTML interface which may change. Some features like instant answers are not available in the HTML version used by ddgr.

HISTORY

ddgr was created by Arun Prakash Jana as a privacy-focused alternative to googler (a similar tool for Google search). The project emphasizes user privacy by leveraging DuckDuckGo's no-tracking policy and support for the Tor network.

SEE ALSO

googler(1), surfraw(1), w3m(1), lynx(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community