Everyone knows how to google from a web browser, but an ambitious computer geek loves to shine in his or her terminal. Believes that you are on your server without graphic environment and you need to verify an error message which appears. In this article we will show you two tools to access google from terminal.
w3m is a World Wide Web (WWW) text based client which can be used to display html documents as well as a pager. Does w3m support images? Yes it does, but you can not view images in a Gnome Terminal or KDE Console, you need an Xterm terminal to display images while browsing with this amazing tool for computer geeks.
The following command will help us to install the World Wide Web text based client on our Linux machine.
On Debian, Mint, Ubuntu you can do
# apt-get install w3m w3m-img
After the installation is finished, run the following command to use google from the terminal. Note: Use the arrow keys to navigate through links and boxes and type enter if you want to put text in a box.
# w3m www.google.com
Another cool thing is that, you can access your Gmail account directly from the terminal via the w3m tool.
You can use w3m as browser using below command.
# w3m www.linoxide.com
As you can see from the following screenshot, we are not able to view any image.
Xterm terminal can help us to display images and view them.
You can use the w3m tool with
-M option for monochrome display. For more options read the man page.
# w3m -M www.linoxide.com
googler is a power tool to Google (Web & News) and Google Site Search from the command-line. It shows the title, URL and abstract for each result, which can be directly opened in a browser from the terminal. Results are fetched in pages (with page navigation). Supports sequential searches in a single
is developed using Python and can be found on its developer’s GitHub repository which isn't affiliated to Google in any way. It was initially written to cater to headless servers without X. You can integrate it with a text-based browser. However, it has grown into a very handy and flexible utility that delivers much more.
Wee need to add the repo before installing it.
# add-apt-repository ppa:twodopeshaggy/jarun # apt-get update # apt-get install googler
Now that it's installed, you can verify the version
# googler -v 3.1
You can search a website on google from your terminal
You can use
n command to fetch previous or next page. If you open your browser and go to google to view the result, you will have exactly the same thing.
You can do a particular research on a website. You will indicate words. It is also possible to define the limit of the result to display.
# googler -n 5 -w linoxide.com \"Advanced Linux\"
it is possible to filter the result only for the last days or months.
# googler -w linoxide.com -t d5 press w
options available with googler:
optional arguments: -s N, --start N start at the Nth result -n N, --count N show N results (default 10) -t dN, --time dN time limit search [h5 (5 hrs), d5 (5 days), w5 (5 weeks), m5 (5 months), y5 (5 years)] -w SITE, --site SITE search a site using Google -v, --version show program's version number and exit omniprompt keys: n, p fetch the next or previous set of search results index open the result corresponding to index in browser f jump to the first page g keywords new Google search for 'keywords' with original options should be used to search omniprompt keys and indices q, ^D, double Enter exit googler * other inputs issue a new search with original options
You can visit the github repository to have the latest release and if you need more information about googler command.