{"id":34115,"date":"2021-07-04T17:03:04","date_gmt":"2021-07-04T17:03:04","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=34115"},"modified":"2021-07-04T17:03:04","modified_gmt":"2021-07-04T17:03:04","slug":"search-duckduckgo-from-terminal-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2021\/07\/search-duckduckgo-from-terminal-ubuntu\/","title":{"rendered":"Search DuckDuckGo from Terminal in Ubuntu Linux via ddgr Command"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/duckduckgo-icon.png\" alt=\"\" width=\"250\" height=\"250\" class=\"alignleft size-full wp-image-34116\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/duckduckgo-icon.png 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/duckduckgo-icon-150x150.png 150w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/p>\n<p>For command line users want to search on DuckDuckGo, ddgr is the free open-source tool to search from Linux terminal.<\/p>\n<p>It&#8217;s a tiny tool written mostly in Python3. And it&#8217;s quite easy to use. For instance, run the command below will search &#8216;Windows 11&#8217; and output 10 results per page.<\/p>\n<pre>ddgr Windows 11<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/ddgr-win11.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/ddgr-win11.png\" alt=\"\" width=\"600\" height=\"396\" class=\"aligncenter size-full wp-image-34118\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/ddgr-win11.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/ddgr-win11-300x198.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>You can then type <b>n<\/b> \/ <b>p<\/b> \/ <b>f<\/b> and hit Enter to go next page, previous page, or to the first page.<\/p>\n<p>By typing <code>o 1<\/code> will open the first result, and <code>c 1<\/code> will copy the first URL into clipboard. And you can type <b>?<\/b> to get more actions in the search output.<\/p>\n<p>Result number per page can be set via <code>--num<\/code>. And you can specified website to search via <code>--site<\/code> flag. <\/p>\n<p>For example, search Ubuntu 21.10 on Ubuntu.com with 3 results per page, run:<\/p>\n<pre>ddgr --num 3 --site ubuntu.com ubuntu 21.10<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/ddgr-ubuntu.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/ddgr-ubuntu.png\" alt=\"\" width=\"600\" height=\"296\" class=\"aligncenter size-full wp-image-34119\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/ddgr-ubuntu.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/ddgr-ubuntu-300x148.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>To automatic open the first result in web browser, use <code>-j<\/code> or <code>--ducky<\/code> flag. For example:<\/p>\n<pre>ddgr --ducky Windows 11<\/pre>\n<p>For Ubuntu Server without desktop UI, you can firstly specify text-based web browser, <code>w3m<\/code> in the case, easily via:<\/p>\n<pre>export BROWSER=w3m<\/pre>\n<p>Other features include:<\/p>\n<ul>\n<li>DuckDuckGo Bangs<\/li>\n<li>Search and option completion scripts (Bash, Fish, Zsh)<\/li>\n<li>Search file type: <code>filetype:mime<\/code><\/li>\n<li>HTTPS proxy support<\/li>\n<li>Do Not Track set by default<\/li>\n<\/ul>\n<h3>How to Install ddgr in Ubuntu:<\/h3>\n<p>The nifty tool is available in Ubuntu repositories. You can install it simply by running command in terminal:<\/p>\n<pre>sudo apt install ddgr<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/apt-ddgr.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/apt-ddgr.png\" alt=\"\" width=\"600\" height=\"189\" class=\"aligncenter size-full wp-image-34120\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/apt-ddgr.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/07\/apt-ddgr-300x95.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>As Ubuntu does not provide the software updates, you can always get the latest <i>.deb<\/i> package from the link below:<\/p>\n<div class=\"wp-block-buttons aligncenter\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-vivid-cyan-blue-to-vivid-purple-gradient-background has-text-color has-background\" href=\"https:\/\/github.com\/jarun\/ddgr\/releases\" target=\"_blank\" rel=\"noreferrer noopener\">ddgr Github releases<\/a><\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>For command line users want to search on DuckDuckGo, ddgr is the free open-source tool to search from Linux terminal. It&#8217;s a tiny tool written mostly in Python3. And it&#8217;s quite easy to use. For instance, run the command below will search &#8216;Windows 11&#8217; and output 10 results per page. ddgr Windows 11 You can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":34117,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52],"tags":[2044],"class_list":["post-34115","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-app-review","tag-duckduckgo"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/34115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=34115"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/34115\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/34117"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=34115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=34115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=34115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}