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
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
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 https://github.com/jarun/ddgr.git
Step 3: Then go into ddgr folder and install ddgr.
cd ddgr sudo make install
Step 4: Now ddgr is installed on the system. You can check it by command
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.
Here in the place of KEYWORD replace any search query. Here is example
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
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
We can see the complete URLs of sites.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.