DuckDuckGo is a popular web search engine known for its strict privacy policies and features. Recently, it has grown in popularity with privacy enthusiasts who are committed to its privacy-friendly search experience.
If you too use DuckDuckGo for all of your web searches and prefer to use the command line for most of the operations on your computer, ddgr is a useful utility that you can use the Terminal to perform DuckDuckGo queries.
Below is a guide that explains ddgr and the steps to browse DuckDuckGo from the Linux command line.
What is ddgr?
ddgr is a command line tool that you can use to search DuckDuckGo from the terminal. It returns results in HTML format and you can navigate through them using your keyboard.
While the standard ddgr interface takes up minimal space without compromising readability, you have the option to customize some of its aspects such as the string text, the number of results displayed per page, and so on.
Some of the notable features of ddgr are:
- Fast and immediate processing of results
- Easy navigation
- Support for DuckDuckGo! Bang
- Search results filter by time, region, etc.
- Browser integration
- HTTPS proxy support
- Do not pursue
- Minimal dependencies
- REPL support for continuous searches
How to install ddgr on Linux
Getting ddgr up and running on your Linux machine is very easy. And similar to installing other programs on Linux, you can also install ddgr in a number of different ways.
So, depending on the distribution you are using, follow the instructions in the following sections to install ddgr.
Install ddgr under Debian / Ubuntu
The installation of ddgr on Debian and its derivatives is easy thanks to the APT package manager. To do this, open Terminal and run the following command:
sudo apt-get install ddgr
When prompted, press and and hit Enter to continue the installation.
Another way to install ddgr alongside the APT package manager on Debian-based Linux distributions is to use a DEB package file. To do this, first download the ddgr-DEB package to your computer using the link below.
Download: ddgr (DEB package)
When you’re done, open up Terminal and use the cd command to change the directory to Downloads (or the directory where you just downloaded the package).
Next, run the following command to install the package:
sudo dpkg -i ddgr_x.x.x-x_ubuntuXX.XX.amd64.deb
Install ddgr with Snap
Snap is one of the easiest ways to install a package on Linux. If you are using a Linux distribution other than Debian or its derivatives that does not have a package for ddgr in its repositories, you can use Snap to install ddgr on your system.
To do this, make sure you have installed Snap on your computer first.
If this returns a version number, Snap is present on your computer and you can move on to the next step. If it doesn’t, you’ll need to install Snap first.
Now that you’ve managed to install Snap on your device, you can install ddgr by running:
sudo snap install ddgr
How to use ddgr to find DuckDuckGo
Searching DuckDuckGo with ddgr is as easy as taking a few simple steps. First open the terminal as ddgr will work there. Next, enter your search query in the following syntax to look it up on DuckDuckGo:
To the example:
This is what the output looks like:
Configure the number of results returned
Once you run a query, the output will show a list of search results related to your search query.
By default, ddgr only lists 10 results at a time. However, you can choose to show more / less results at a time by explicitly specifying the number of results you want to show in the following way:
ddgr -n x your_search_query
…Where x is the number of results you want to display.
Open a link from returned results
Each ddgr result in the list is numbered. This number is called the index of a result and you can use it to open the corresponding link.
For example, if you want to open the link number 5 simply enter from the results in a browser 5 in the omniprompt – the prompt you see in Terminal after making a query in ddgr – and press Enter.
Integrate ddgr with text-based browsers
By default, ddgr opens links in the standard web browser on your Linux computer. However, it also supports a number of text-based browsers such as w3m, lynx, elinks, and www-browser that you can use to open the search results.
To set a browser as the default, all you have to do is set the environment variable Therefore. To do this, run the following command in a terminal window:
Alternatively, if you only want to use a browser for a specific query, you can do it as follows:
BROWSER=w3m ddgr your_search_query
Do a I’m Feeling Ducky search
Just like the Google search “I’m Feeling Lucky”, DuckDuckGo also has its own version of it called “I’m Feeling Ducky”. If you don’t know, this option bypasses all results in the SERP and directly opens the first link in the list.
With ddgr you can do a “I’m Feeling Ducky” search using the following syntax:
ddgr -j lucky your_search_query
Do a DuckDuckGo! Bang Search
As mentioned in the manual, ddgr also supports DuckDuckGo! Bang, which are shortcuts (or short commands) that allow you to look up your query directly on a website without having to visit it.
Assuming you want to learn more about DuckDuckGo on Wikipedia, you can just do it by running the following command:
ddgr !w duckduckgo
If you’re on the bash shell, you have to escape it ! Character. If you did this, your command would look like this:
ddgr !w duckduckgo
Do a website specific search
Similar to using DuckDuckGo! Bangs in ddgr, you can also use the -w Sign. For example, if you want to search for mechanical keyboards on Amazon, you can do it more efficiently using the following command:
ddgr -w amazon.com mechanical keyboard
Search for a specific file type
Sometimes you may just want to find a certain type of file on the internet. In such cases, ddgr can help you filter out your results by adding the file type to your search query.
To the example, let’s say you want to look up image files (PNG) in the DuckDuckGo search engine. With ddgr you can do this as shown in the following command:
ddgr duckduckgo filetype:png
Get help at ddgr
If you are unsure about how to use a ddgr command or want to learn more, you can always get command line help by using:
Search more efficiently on DuckDuckGo
With ddgr installed and running on your Linux machine, you can now search DuckDuckGo more efficiently without ever opening DuckDuckGo in a browser.
ddgr supports a number of different operations and customization options than what we covered in this guide. To check them out, go to GitHub by ddgr.
Also, DuckDuckGo’s! Bang feature can come in handy when you want to get more out of your browsing experience.