← 返回
效率工具 中文

Ddg

Use ddgr (DuckDuckGo from the terminal) to perform privacy-focused web searches from the command line. Use when the user wants to (1) Search the web from the terminal, (2) Perform DuckDuckGo searches without opening a browser, (3) Get quick search results in text format, (4) Search privately without tracking, (5) Use DuckDuckGo bangs (!) from terminal.
使用 ddgr(终端版 DuckDuckGo)在命令行中进行注重隐私的网络搜索。适用场景:(1) 在终端内搜索网页;(2) 免开浏览器直接使用 DuckDuckGo;(3) 获取纯文本格式的快速搜索结果;(4) 进行无追踪的隐私搜索;(5) 在终端中使用 DuckDuckGo 快捷指令 (!)。
instant-picture
效率工具 clawhub v1.0.0 1 版本 99619.4 Key: 无需
★ 1
Stars
📥 3,121
下载
💾 160
安装
1
版本
#latest

概述

ddgr - DuckDuckGo from the Terminal

ddgr is a command-line utility to search DuckDuckGo from the terminal. It provides fast, privacy-focused web searches without opening a browser.

Installation

Via Snap (recommended for Ubuntu):

sudo snap install ddgr

Via PPA:

sudo add-apt-repository ppa:twodopeshaggy/jarun
sudo apt-get update
sudo apt-get install ddgr

From source:

git clone https://github.com/jarun/ddgr.git
cd ddgr
sudo make install

Dependencies: Python 3.8 or later

Basic Usage

Simple search (non-interactive):

snap run ddgr "search query" --np

Search with specific number of results:

snap run ddgr "search query" --num 5 --np

Search with time limit:

snap run ddgr "query" --time w --np    # past week
snap run ddgr "query" --time m --np    # past month
snap run ddgr "query" --time y --np    # past year

Site-specific search:

snap run ddgr "query" --site github.com --np

JSON output:

snap run ddgr "query" --json --np

Open first result in browser:

snap run ddgr "query" --ducky

Interactive Mode

Run without --np to enter interactive mode:

snap run ddgr "search query"

Interactive commands:

  • 1, 2, 3... → open result in browser
  • n → next page of results
  • p → previous page of results
  • q or Ctrl+D → quit
  • ? → show help

Advanced Options

OptionDescription
---------------------
-n N, --num NShow N results per page (0-25, default 10)
-r REG, --reg REGRegion-specific search (e.g., 'us-en', 'uk-en')
-t SPAN, --time SPANTime limit: d (day), w (week), m (month), y (year)
-w SITE, --site SITESearch specific site
-x, --expandShow complete URLs
--jsonOutput in JSON format
--duckyOpen first result in browser
--np, --nopromptNon-interactive mode
--unsafeDisable safe search

DuckDuckGo Bangs

Use DuckDuckGo bangs to search specific sites:

snap run ddgr "!w Linux" --np        # Wikipedia search
snap run ddgr "!yt music" --np       # YouTube search
snap run ddgr "!gh python" --np      # GitHub search
snap run ddgr "!a books" --np        # Amazon search

Make it Easier with an Alias

Add to ~/.bashrc or ~/.zshrc:

alias ddg='snap run ddgr'

Then use:

ddg "search query" --np

Privacy Features

  • No user tracking or profiling
  • Do Not Track enabled by default
  • Works over Tor network (with proxy)
  • HTTPS proxy support
  • No stored search history

Examples

Search for tech news:

snap run ddgr "latest AI news 2025" --num 5 --np

Find Ubuntu tutorials:

snap run ddgr "Ubuntu tutorial" --site askubuntu.com --np

Search recent Python documentation:

snap run ddgr "Python 3.12 features" --time m --np

Use bang to search Wikipedia:

snap run ddgr "!w OpenClaw" --np

Troubleshooting

Command not found:

  • Ensure ddgr is installed via snap: sudo snap install ddgr
  • Use full command: snap run ddgr instead of just ddgr

No results:

  • Check internet connection
  • Try without --np to see if interactive mode works
  • Verify DuckDuckGo is accessible in your region

Slow response:

  • DuckDuckGo HTML interface can be slower than main site
  • Use --time to limit results by time for faster queries

More Information

  • GitHub: https://github.com/jarun/ddgr
  • DuckDuckGo: https://duckduckgo.com
  • Bangs: https://duckduckgo.com/bang

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 12:26 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Clonev

instant-picture
使用Coqui XTTS v2克隆任意声音并生成语音。只需提供6‑30秒WAV样本和文本,即可得到克隆声音的音频。支持14+语言。适用场景:①克隆本人或他人声音;②生成特定人物语音;③制作个性化语音消息;④多语言声音克隆(用克隆声音说任意语
★ 0 📥 2,623
productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 444 📥 226,121
productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,739