Browsing the internet from the command line

There are actually a bunch of text-mode web-browsers, these are my top three :)

  • ELinks (install):

    elinks screenshot

    • Keyboard Shortcuts

      • Open new tab - t
      • Goto URL - g
      • Go back - Left
      • Go forward - u
      • Exit - q
      • Toggle images - *
      • Toggle link numbering - .
      • Toggle document colours - %
      • Next tab - >
      • Previous tab - <
      • Close tab - c
      • Open in new tab in background - T
    • Automatic URL rewrites

      • d - dictionary search
      • dmoz - dmoz search
      • g - google search
      • wiki - wikipedia search

    (source)


  • Lynx (install):

    lynx screenshot

    • Lynx User-Guide


  • w3m (install):

    w3m screenshot

    • w3m Manual


Wikipedia has a List of more text-based web-browsers, not all of which are available in Ubuntu.


To my surprise it exists; I installed it and it works!

 sudo apt-get install w3m w3m-img
  • to open a webpage simply type in a terminal window: w3m <url_of_the_webpage>
  • to open a new page: type Shift-U
  • to go back one page: Shift-B
  • open a new tab: Shift-T

W3M can handle Gmail(!)

If you use for example XTerm (not Gnome Terminal), W3M is even capable of showing images!

For more information see “How to Browse From the Linux Terminal With W3M”.


links2 -g is a strange terminal-embedded graphical-mode browser. It's fast but hates modernity.

If you like to search from the command line, try surfraw .

   Surfraw  provides  a fast unix command line interface to a variety of
   popular WWW search engines and other artifacts of power.  It reclaims
   google,  altavista, dejanews, freshmeat, research index, slashdot and
   many others from the false‐prophet,  pox‐infested  heathen  lands  of
   html‐forms,  placing  these  wonders  where they belong, deep in unix
   heartland, as god loving extensions to the shell.

Trivia note : Surfraw was originally written by Julian Assange. (Acronym/backronym for 'SURFRAW' is Shell Users' Revolutionary Front Rage Against the World Wide Web.)

Here's some example usage. To search Google for "nm-applet memory leak" :
sr google nm-applet memory leak

To search for an RFC dealing with S/MIME:
sr rfc s/mime

Translate a word:
sr translate logiciel

Find torrents:
sr piratebay natty narwhal

More advanced, from surfraw.alioth.debian.org :

     $ surfraw google -results=100 RMS, GNU, which is sinner, which is sin?
     $ sr wikipedia surfraw
     $ sr austlii -method=phrase dog like
     $ /usr/lib/surfraw/rhyme -method=perfect Julian

You can set it up with some defaults in .config/surfraw/conf :

SURFRAW_graphical_browser="/usr/bin/links2 -g"
SURFRAW_text_browser="/usr/bin/elinks"
SURFRAW_graphical=yes