Many users don’t know CommandLine can do Web-Search too

  • Post last modified:April 27, 2021
  • Reading time:8 mins read

When we want to search for something on the Internet, we directly jump to our favorite web-browser like Chrome, Firefox, Brave, or any sort of browser. Have you ever thought we can do a search from the terminal itself?

In the past, when the graphical browser was not in the boom or when the internet speed was not less than snail-paced people was used to terminal-based browser.

This type of browser is not limited to GNU Linux Environment. It is available for Microsoft Windows, Mac-OS, etc.

If you question why we should use a Terminal-based Browser instead of an aesthetic Graphical Browser.

Readers, your intuition is correct. I’ll give you the five bullet reasons why you should use CommandLineBrowser in 2021.

  • If you are geeky who like to have all work done from the terminal itself
  • Privacy Concern (No JavaScript support)
  • Slow Bandwith Connection
  • Read Webpage without any distraction
  • Stuck with CLI and need to Browse the Internet

If you agree with the above bullet point, I think so you are ready to know about the command-line based browser.

In this article, we will show you the four command-based browser tools though you can access your favorite browser.

1. W3M

DuckDuckGo in w3m
DuckDuckGo in w3m

w3m is a popular open-source text-based web browser for the terminal. It stands for “WWW wo miru ” the first release was in 1995, and The original projects were inactive, and now it’s handled by Tatsuya Kinoshita.

When you load the website from w3m, it tries to render a page as an Original web-page in the terminal. If you are skeptical about privacy, I must say you w3m doesn’t support JavaScript, so don’t think much about privacy issues.

The key point to using w3m is it supports tables, frames, SSL connections, color, and Inline Images.

How to Install w3m

We need to install the w3m package to access the web-page from the terminal. By default w3m package is not pre-install in most of the Linux distribution.

To Install W3M package on Linux Based Distribution pass the following commands

For Debian/Ubuntu Based Users

$ sudo apt install w3m w3m-img

CentOS/RPM Users

$ sudo yum install w3m

Once the installation is complete, let’s verify whether w3m is installed successfully to verify pass command:

[email protected]:~$ w3m -version

w3m version w3m/0.5.3+git20190105, options lang=en,m17n,image,color,ansi-color,mouse,gpm,menu,cookie,ssl,ssl-verify,external-uri-loader,w3mmailer,nntp,gopher,ipv6,alarm,mark,migemo

How to use w3m

We have installed w3m. Now it’s time to operate w3m and find how interesting it is. To use w3m, we can use hotkeys to navigate between webpage links.

When you know the specific website URL pass the following command:

$ w3m [url]

In a real scenario, for example, I need to access my own website. I’ll type a command like

$ w3m trendoceans.com
trendoceans.com loaded in w3m
trendoceans.com loaded in w3m

Few handy shortcuts to use while accessing web-page such as:

  • For navigation, you can use the arrow key. If you want to scroll down, press the down arrow or vice-versa.
  • To click on a specific link, press enter key. All the Hyperlinks are highlighted in blue color.
  • When you want to exit from the web-page without confirmation, press Shift + Q with confirmation use Q.
  • If you want to go back, press Shift + B and Shift + U to open a new URL.

There are many other hotkeys are available to use on w3m for that, you can read the manual page.

$ man w3m

2. Lynx

lynx command-line browser
lynx command-line browser

Lynx is one of the oldest and most used command-line text browsers. First Lynx released was 29 years ago and still maintained by a group of volunteers led by Thomas Dickey.

A w3m and Lynx command-line text browser are almost similar, and Lynx does not support JavaScript and graphics, so that you can rely upon them regarding privacy concerns.

One of the key features of Lynx is you can highlight the link using a cursor that you can’t do on different command-line browsers, and many other features like Lynx ask your consent to accept cookies or not.

By default It supports SSL, Tables, frame and basic HTML features.

How to Install Lynx

Lynx can be installed on most of the Linux distribution. To install Lynx, open the respective terminal and pass the following command:

Debian/Ubuntu users

$ sudo apt install lynx

CentOS/RPM users

$ sudo yum install lynx

Once the installation is complete, let’s verify whether lynx is installed successfully to verify pass command:

[email protected]:~$ lynx -version

Lynx Version 2.9.0dev.5 (27 Feb 2020)
libwww-FM 2.14, SSL-MM 1.4.1, GNUTLS 3.6.13, ncurses 6.2.20200212(wide)
Built on linux-gnu.

Copyrights held by the Lynx Developers Group,
the University of Kansas, CERN, and other contributors.
Distributed under the GNU General Public License (Version 2).
See https://lynx.invisible-island.net/ and the online help for more information.

How to Use Lynx

We have installed lynx on Our System. Let’s try to find out to access the webpage from lynx. To access lynx, you can use different flags and hotkey.

When you pass the command lynx for the first, you will be overwhelmed with the keys and Options. Believe me, and it is very easy to understand.

If you are looking for something and you are not able to find it, please use the H (Help) after lynx command

$ lynx
H

When you know the specific website URL pass the following command:

$ lynx [url]

In a real scenario, for example, I need to access my own website. I’ll type a command like

$ lynx trendoceans.com

Once you pass the command, it will ask you to confirm cookies if you want to deny type N.

Lynx ask for cookies consent
Lynx ask for cookies consent

TrendOceans page is loaded on lynx command-line based browser you can use hotkeys to navigate.

Web-page loaded in Lynx
Web-page loaded in Lynx

Few handy shortcuts to use while accessing web-page such as:

  • For navigation, you can use the arrow key. If you want to scroll down, press the down arrow or vice-versa.
  • To click on a specific link, press enter key. All the Hyperlinks are highlighted in green color when you reached on hyperlink color change into amber.
  • When you want to exit from the web-page without confirmation, press Shift + Q with confirmation use Q.

To get more information about lynx pass the help command in terminal

$ lynx
H

3. links2

links2 CLI cum GUI Browser
links2 CLI cum GUI Browser

Links2 is a command-line cum graphical web browser It is developed by Twibright Labs. Its unique feature is you can integrate a mouse from the above command-line browser. You are not able to use a mouse except in lynx for highlighting.

A web-page will load faster without any CSS support, and JavaScript support is enabled with restrictions; however, one thing is missing cookies consent. If developer teams add this feature in the upcoming release, that would be great.

How to Install links2

It is very simple to install Links2 on your Linux Distributions. To install, pass the following commands

Debian/Ubuntu users

$ sudo apt install links2

CentOS/RPM users

$ sudo yum install links2

Once the installation is complete, let’s verify whether links2 is installed successfully to verify pass command:

[email protected]:~$ links2 -version

Links 2.20.2

How to Use links2

This command is a little bit different compare to other command-based browsers. Let’s find out what is the difference you may find.

When you use this, you will feel like your accessing a mini browser. It has the menu options file save and many other options.

If you want to visit on a specific website URL pass the following command:

$ links2 [url]

In a real scenario, for example, I need to access my own website, I’ll type a command like

$ links2 trendoceans.com
Web-Page loaded in links2
Web-Page loaded in links2

Few handy shortcuts to use while accessing web-page such as:

  • For navigation, you can use the arrow key. If you want to scroll down, press the down arrow or vice-versa.
  • To click on a specific HyperLink, press enters key.
  • When you want to exit from the web-page without confirmation, press Shift + Q with confirmation use Q.
  • It is very easy to toggle between source code and web-page using \.
  • If you want to go any specific URL, use hotkey G.

There are many other hotkeys are available to use on links2 for that, you can read the manual page.

$ man links2

Wrap-up

That’s it for today. From now onward, you don’t just require a graphical web-browser to access web-page.

What do you think about command-line based web-browser? Please let me know.

If you want to see what funny commands you can pass on Linux terminals, read these 5 Funny Linux commands, Literally, we can do?

Anything you want me to cover, please let me know in the comment section, and your feedback will be highly appreciated.

Like what you read? Please share it with others.
  • 1
    Share

Leave a Reply