How To Search DuckDuckGo From Terminal Using ‘ddgr’?

If you talk to a developer or sysadmin, you’ll realize the importance of command line while working on a Unix-like operating system. In many cases, command line interface lets you access the lower levels of your machine. As a result, there is an abundance of Linux commands that you can use to take control of your hardware and software installed on it.

From time to time, we keep sharing interesting Linux terminal tricks to make your overall experience more fun. While working on a computer, one of the primary tasks performed by us is surfing the web to gain knowledge. For many of you, Google is the go-to destination while performing the search on the web. However, if you’re privacy-oriented, you need to use DuckDuckGo.

ddgr — Use DuckDuckGo from Linux terminal

In a previous article, we’ve already told you how to use a popular tool named googler to perform Google searches from the Linux command line. For DuckDuckGo, you can use ddgr cmdline utility, which I recently spotted on Reddit. It goes without saying that this tool isn’t affiliated with DuckDuckGo.

With this tool, you can specify the number of search results you wish to see on a search page. “The default interface is carefully designed to use minimum space without sacrificing readability,” the GitHub page of ddgr states.

Its highlight features are:

  • Specify number of results per page
  • DuckDuckGo Bang support
  • Fast, clean, ad-free
  • Keywords support
  • HTTPS proxy support
  • Do Not Track
  • Non-stop searches
  • Control search by time, region
  • Disable safe searchfwe

How to install and use ddgr in Linux?

Before attempting to install ddgr tool, please note that it requires Python 3.6 or later. To check your Python 3 version, run the following command:

python3 --version

Having confirmed that you’re all set, run the following command to install ddgr from a PPA on your Ubuntu distro or its derivatives. On ddgr’s GitHub page, you can find the instructions to install the same on other distros as well.

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

After installing ddgr tool to use DuckDuckGo from command line, you’re ready to use it. To do so, run the following command:


Now, enter the search term to perform the action:


As you can see in the picture, the top DuckDuckGo results for fossbytes are listed:

ddgr search terminalYou can directly combine the above two arguments and perform search:

ddgr searchterm

In case you wish to open the first result in browser, follow this pattern;

ddgr -j searchterm

ddgr duckduckgo open in browser

To search the contents of a site, follow this pattern and enter search query when prompted:

ddgr -w

ddgr site searchFor viewing the complete URLs in search result, use -x:

ddgr -x searchterm

To exit ddgr, hit double Enter or use q key. For help and complete list of supported cmdline options, use help command:

ddgr -h

ddgr helpYou can visit ddgr’s GitHub page to know more information and register your issues. Give it a try, use DuckDuckGo from terminal, and share your views about the same.

Don’t forget to check a few more terminal tricks:

Adarsh Verma

Adarsh Verma

Fossbytes co-founder and an aspiring entrepreneur who keeps a close eye on open source, tech giants, and security. Get in touch with him by sending an email — [email protected]
More From Fossbytes

Latest On Fossbytes

Find your dream job