Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to Search DuckDuckGo from the Linux Terminal?

  • Last Updated : 11 Feb, 2021

DuckDuckGo is a search engine like Google, but it takes more care about user search protecting its privacy. To search from a terminal there is one tool called ddgr. This tool provides us the ability to search from the terminal by using the DuckDuckGo search engine.

Installation of ddgr

Required tools for ddgr installation:

  • Python3.3 or later.
  • Python request library
  • git

Step 1: To install prerequisites on Debian based systems like Ubuntu or Kali Linux run the following commands.

sudo apt install python3 python3-requests  git

Installing git

To install the prerequisites on systems like CentOS and RHEL:

yum install epel-release
yum install python34 python34-requests
yum install git

Now prerequisites are installed on the system. Now let’s install ddgr.

Step 2: Clone the repository of ddgr.

git clone

How to Search DuckDuckGo from the Linux Terminal

Step 3: Then go into ddgr folder and install ddgr.

cd  ddgr
sudo make install

How to Search DuckDuckGo from the Linux Terminal

Step 4: Now ddgr is installed on the system. You can check it by command

 ddgr -h

How to Search DuckDuckGo from the Linux Terminal


This is a help message which tells us how to use ddgr. Now let’ see how to use it. To search on ddgr use the following command.

ddgr  KEYWORD 

Here in the place of  KEYWORD  replace any search query. Here is example

Searching through ddgr

To open the link in the browser enter the link number as an input. To exit from ddgr use key CTRL+d or q. Now let’s see an option that can be used with ddgr.

-n option: This option is used to set the number of results per page. The default result per page is 10. Use the following command:

ddgr -n N  KEYWORD 

In the above command replace the N with the number for the number of results per page. Example is

ddgr -n 2 geeksforgeeks

ddgr search

We can see that there is only two results appear on the page.

-j option: By using this option we can option the first result into GUI browser.An example of this option is

ddgr -j geeksforgeeks

-x option: By using this option we can see the full URL in the result. Here is an example.

ddgr -x GeeksForGeeks

Searching through ddgr

We can see the complete URLs of sites.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!