Search DuckDuckGo From the Linux Terminal

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:

MAKEUSEO VIDEO OF THE DAY

  • 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

Related: Does HTTPS protect data in transit?

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 Yes 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

Related: How to Install a DEB File in Ubuntu?

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.

snap –version

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:

ddgr your_search_query

For example:

ddgr makeuseof

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 also show more / less results at the same 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.

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 make a browser the default, all you need to do is set the environment variable for it. To do this, run the following command in a terminal window:

export BROWSER = w3m

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

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 an "I'm Feeling Ducky" search with the following syntax:

ddgr -j lucky your_search_query

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

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.

For example, suppose 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 file type: 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:

ddgr –help

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, visit ddgr's GitHub.

Also, DuckDuckGo's! Bang feature can come in handy when you want to get more out of your browsing experience.

25 Cool DuckDuckGo Bangs That Will Make Google Search Look Slow

DuckDuckGo's pop function is one of the most time-saving and practical tricks. Here are 25 useful DuckDuckGo bangs to get you started!

Continue reading

About the author

Yash Wate
(35 published articles)

Yash is Staff Writer at MUO for DIY, Linux, programming and security. Before he discovered his passion for writing, he developed for the web and iOS. You can also find his writing on TechPP where he covers other industries. Tech aside, he likes to talk about astronomy, Formula 1, and clocks.

More
By Yash Wate

Subscribe to our newsletter

Subscribe to our newsletter for tech tips, reviews, free e-books, and exclusive deals!

Click here to subscribe

Leave a Reply

Your email address will not be published.