How to Browse From the Linux Terminal With W3M

how-to-browse-from-the-linux-terminal-with-w3m photo 1

W3M is a terminal web browser for Linux. It’s got a few tricks up its sleeve, including support for images, tabs, tables, frames and other features not usually included with terminal web browsers.

If you’ve used Linux for a while, you probably remember using a terminal browser to Google up a solution for your hardware when the X server refused to load. Modern X servers have advanced far beyond this, but W3M and other terminal browsers can still be useful.

how-to-browse-from-the-linux-terminal-with-w3m photo 2

Installing W3M

W3M isn’t included by default on most Linux distributions. You’ll want to install the main w3m package and the w3m-img package if you want inline image support. Use the following command on Ubuntu:

sudo apt-get install w3m w3m-img

Basic Browsing

W3M has quite a few command-line options, but none are mandatory. The only thing you need to specify is a web page address. Want to bring up Google? Just use the w3m google.com command.

how-to-browse-from-the-linux-terminal-with-w3m photo 3

You can use the arrow keys to move the cursor around or click at a desired location to move the cursor there. If you want to type in a text box, select the text box with your cursor and press Enter before typing your text. W3M treats your keystrokes as commands if you just start typing.

how-to-browse-from-the-linux-terminal-with-w3m photo 4

Load a hyperlink by selecting it with your cursor and pressing Enter. You don’t have to select hyperlinks manually — press the Tab key to position your cursor over the next hyperlink on the page.

how-to-browse-from-the-linux-terminal-with-w3m photo 5

Shift-B will take you back a page. If you want to load a different URL, press Shift-U and you’ll get an URL prompt. Press Shift-H to view the help page if you want to see a more complete list of keyboard shortcuts.

Images in the Terminal

how-to-browse-from-the-linux-terminal-with-w3m photo 6

W3M supports images, so where are they? Well, terminals like GNOME Terminal and KDE’s Konsole can’t display W3M’s images. Other terminals, such as Xterm, can. W3M will also display images if you’re running it in a framebuffer console, so you don’t need an X server running to take advantage of this feature.

how-to-browse-from-the-linux-terminal-with-w3m photo 7

Another feature that doesn’t work in GNOME Terminal or Konsole is W3M’s right-click menu.

how-to-browse-from-the-linux-terminal-with-w3m photo 8

Browser Tabs

How did we ever live without tabs? They’re an essential feature for desktop web browsers. W3M includes tabs, too. Just press Shift-T to open a new tab.

how-to-browse-from-the-linux-terminal-with-w3m photo 9

You can switch between tabs by clicking them, but we’re trying to be terminal ninjas here. Use the { and } keys to switch between tabs without touching your mouse (that’s Shift-[ and Shift-]).

Gmail in the Terminal

W3M isn’t stuck in the past, like Lynx (another web browser for the terminal) is. It can render tables, frames and even has support for Gmail’s basic HTML interface.

how-to-browse-from-the-linux-terminal-with-w3m photo 10

You’d probably feel more comfortable accessing Gmail with an IMAP client from your terminal, but hey — it works.

More Documentation

In addition to pressing Shift-H to view W3M’s help page, you can view the full manual on W3M’s website. The manual lists all of W3M’s command-line switches and key bindings.


W3M still doesn’t compare with desktop browsers — notably, it doesn’t support JavaScript. There’s an experimental w3m-js extension you can compile and install yourself, but I wouldn’t rely too much on that. Then again, do you really want JavaScript in a terminal browser?

More stories

Week in Geek: Japan Developing a Malware Cyberweapon

Our latest edition of WIG has lots of news link goodness covering topics such as Google’s demotion of Chrome in search results, Ramnit malware’s theft of over 45,000 Facebook logins, WebOS’s second chance in Healthcare, and more.

Desktop Fun: Simplicity Wallpaper Collection Series 1

Sometimes having a bright or busy looking desktop can be counter-productive, so getting back to the basics is just what you need. Give your desktop the perfect minimalist look with the first in our series of Simplicity Wallpaper collections.