3 web browsers for the Linux command line

750 readers like this.
spider web

Internet Archive Book Images, modified by Opensource.com. CC BY-SA 4.0.

Let's take a trip back in time to the early, simpler days of the web. A time when most of us used low-powered PCs or dumb terminals, often over slow dial-up connections. We generally visited web pages using command-line, text-only browsers like the venerable Lynx.

Jump forward to these days of web browsers like Firefox, Chrome, and Safari. You'd think that browsing the web at the command line would have gone the way of the <blink> tag. You'd be wrong. Web browsers that run in a terminal window are alive and kicking. They're niche, but still get the job done.

Why browse the web from the command line?

There are any number of reasons for browsing the web from the command line. You might be a command line junkie who wants to do everything from the terminal or you might have a slow internet connection. You might want to test a website's accessibility, avoid tracking scripts and annoying advertising. Or, you might just want to read an article or blog post without distractions.

With that out of the way, let's take a look at three browsers for the command line.

Links2

Links2 bills itself as the graphical version of the venerable Links. It's a lot like its predecessor in that it gives you the option to run either in text-only mode or graphical mode.

When you start it by typing links2 at the command line and go to a website, the result is something like this:

links2.png

Reading an Opensource.com article with Links2.

But when you run links2 -g then visit a site, the result is something like this:

links2-graphical.png

Reading an Opensource.com article with Links2 in graphical mode.

That's not the only trick that Links2 can do. The browser can display frames and tables, and supports basic JavaScript. You can also use your mouse to follow hyperlinks whether you're in text or graphical mode.

ELinks

Like Links2, ELinks is a fork of the Links browser. And like Links2, ELinks can display tables and frames. While it supports using a mouse to follow hyperlinks, ELinks lacks support for Javascript.

One feature that makes ELinks stand out from other command line browsers is its menu system. Press ESC on your keyboard display a set of menus that let you enter and save URLs, add bookmarks, set up the browser, and more.

elinks-menus.png

Using the menus in ELinks.

ELinks lacks a graphical mode, but it does have a nifty feature that lets you view images on a web page. Either click the placeholder for the image or highlight it and press v on your keyboard. ELinks opens the image with an application like ImageMagick or GraphicsMagick.

elinks-view-image.png

Displaying an image from a web page.

w3m

When I first fired up w3m, it reminded me of a cross between the classic text-based browser Lynx and the UNIX/Linux text viewer more. While it might not have as many features as the other browsers I discuss in this article, w3m gets the job done.

You can navigate web pages using a mouse, and the browser will render tables and even accept cookies. Like ELinks2, w3m lets you view images on a page using an external program. The browser doesn't do JavaScript, though.

As far as the important job of rendering web pages, w3m does a better job than Links2 or ELinks even with complex pages. The rendering is clean and colorful.

w3m.png

Viewing a web page with w3m.

w3m doesn't use the same keyboard shortcuts as other command line browsers, so get ready to learn some new ones. You can do that by pressing H while running w3m.


Have a favorite command line web browser? Feel free to share it with our community by leaving a comment.

That idiot Scott Nesbitt ...
I'm a long-time user of free/open source software, and write various things for both fun and profit. I don't take myself all that seriously and I do all of my own stunts.

2 Comments

Among the reasons for using a text-based browser, sometimes you're working remotely from an ssh session on a system with no access to GUI browsers (or for that matter, any GUI interface). If you need to configure some gadget on the LAN side via the device's web interface, these text-based browsers come in handy.

Hi
For me the best is lynx http://lynx.browser.org/
Lynx is a highly configurable text-based web browser for use in cursor cell addresses that are addressable by the cursor. It is the oldest web browser Default.
See you
Ernesto Escobedo

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.