Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How can I browse the internet from the command line in Maverick?

share|improve this question
add comment

6 Answers 6

up vote 33 down vote accepted

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)




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

share|improve this answer
add comment

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
share|improve this answer
    
+1 for links2 :) –  Rafał Cieślak Mar 8 '11 at 20:05
add comment

If you meant a CLI based Internet browser, use w3m:

w3m 'http://example.com/'
share|improve this answer
    
This is awesome! I didn't know it existed. –  Ashfame Mar 8 '11 at 17:12
    
There's also links, which I personally like better than w3m. –  Cedric Mar 8 '11 at 17:13
    
links or lynx? I prefer curl -vvv http://example.com/ 2>&1 | less, but that is not really a browser. –  Lekensteyn Mar 8 '11 at 17:24
    
Thanks I was looking for the www command line browser. Looks like w3m is it, or something very close! –  jerome Jan 6 '13 at 3:09
add comment

Another very good command line browser is lynx.

The most basic usage would be:

lynx http://askubuntu.com

It will most likely ask if you want to allow cookies.

To navigate the page use the arrow keys. Here is a short description of the most important ones.

  • Left - move back in history
  • Right - follow a link
  • Up - move to previous focusable item
  • Down - move to next focusable item
  • Enter - enter link / trigger action
  • Backspace - history page
  • Space - move page down by a page
  • b - move page up by a page
  • Shift + q - Quit

That is the most basic key navigation commands.

share|improve this answer
add comment

You want a text browser or a command line method? This is command line, using telnet e.g.

telnet askubuntu.com 80

GET /

It doesn't support SSL, graphics, HTML5 etc and you might have to guess the index page if the server doesn't have a default file. But it is better than nothing and a very quick testing tool.

share|improve this answer
1  
This is the worst web browser ever :D –  Danyal Aytekin Feb 27 at 17:29
add comment

Another program that might work for you is lynx it is a terminal based web browser.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.