How to Search the Web from Linux Terminal
Searching the web is an essential part of our daily routine. But did you know that you can search the web right from the Linux terminal? In this article, we’ll show you how to search the web using the terminal on Linux.
Search Engines
There are several search engines available that can be used from the terminal. Here are the three most popular ones:
1. Google:
Google is the most popular search engine on the web. You can search Google from the terminal by installing a package called “googler.”
To install googler in Ubuntu, run the following command:
$ sudo apt-get install googler
Once installed, you can search Google by running the following command:
$ googler
Replace with your search query. For example, to search for “Linux Mint,” run the following command:
$ googler Linux Mint
2. DuckDuckGo:
DuckDuckGo is a search engine that prioritizes the privacy of its users. You can search DuckDuckGo from the terminal by installing a package called “ddgr.”
To install ddgr in Ubuntu, run the following command:
$ sudo apt-get install ddgr
Once installed, you can search DuckDuckGo by running the following command:
$ ddgr
Replace with your search query. For example, to search for “Linux commands,” run the following command:
$ ddgr Linux commands
3. Wikipedia:
Wikipedia is an online encyclopedia that contains articles on almost every topic you can think of. You can search Wikipedia from the terminal by installing a package called “wikipedia.”
To install wikipedia in Ubuntu, run the following command:
$ sudo apt-get install wikipedia2text
Once installed, you can search Wikipedia by running the following command:
$ wikipedia
Replace with your search query. For example, to search for “Linux operating system,” run the following command:
$ wikipedia Linux operating system
Other Commands
Apart from these search engines, there are some useful Linux terminal commands that you can use to search the web:
1. Curl:
Curl is a command-line tool that can be used to transfer data from or to a server. You can use curl to search the web by running the following command:
$ curl -sL ‘http://www.google.com/search?q=’ | grep -Eo ‘’ | sed ‘s/<\/*title>//g’ | sed -n ‘3,7p’
Replace with your search query. For example, to search for “best Linux distro,” run the following command:
$ curl -sL ‘http://www.google.com/search?q=best+Linux+distro’ | grep -Eo ‘’ | sed ‘s/<\/*title>//g’ | sed -n ‘3,7p’
2. Lynx:
Lynx is a text-based web browser that can be used to browse the web from the terminal. You can use lynx to search the web by running the following command:
$ lynx -dump ‘http://www.google.com/search?q=’ | grep -Eo ‘(.*)’ | sed -n ‘1,11p’
Replace with your search query. For example, to search for “Linux commands,” run the following command:
$ lynx -dump ‘http://www.google.com/search?q=Linux+commands’ | grep -Eo ‘(.*)’ | sed -n ‘1,11p’
Conclusion
In this article, we have demonstrated how to search the web from the Linux terminal. You can use any of the methods mentioned above to perform a web search without having to open a web browser. These methods are not only useful but also time-saving. After all, who doesn’t like getting work done quickly?