Install and using Lynx web browser in Ubuntu

In Ubuntu, you can also surf the Internet or view website in command line terminal. The great browser for command line terminal is Lynx. Lynx package is not install by default. Installing lynx package in Ubuntu is very easy using apt package management system if you already have an Internet connection.

Here is an example on how to install lynx with apt-get:

luzar[email protected]:~$ sudo apt-get install lynx
[sudo] password for luzar:
Sorry, try again.
[sudo] password for luzar:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
lynx
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 1168kB of archives.
After this operation, 4997kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com hardy/main lynx 2.8.6-2ubuntu2 [1168kB]
Fetched 1168kB in 1min39s (11.8kB/s)
Selecting previously deselected package lynx.
(Reading database ... 18984 files and directories currently installed.)
Unpacking lynx (from .../lynx_2.8.6-2ubuntu2_i386.deb) ...
Setting up lynx (2.8.6-2ubuntu2) ...

Now that lynx is successfully installed in our system, let's try open a website:

[email protected]:~$ lynx -accept_all_cookies http://www.google.com

example of lynx opening a website screenshot

In the example above, the option -accept_all_cookies will always accept cookies from website we are going to open. We use this option just avoid answering the question lynx will ask later. Certain web server need us to accept cookies before allowing us to view the website.

There are more options that you use with lynx web browser. Here is some options from lynx manual page:

-accept_all_cookies
accept all cookies.

-anonymous
apply restrictions for anonymous account, see also -restrictions.

-assume_charset=MIMEname
charset for documents that donât specify it.

-assume_local_charset=MIMEname
charset assumed for local files, i.e., files which lynx creates such as internal
pages for the options menu.

-assume_unrec_charset=MIMEname
use this instead of unrecognized charsets.

-auth=ID:PASSWD
set authorization ID and password for protected documents at startup. Be
sure to protect any script files which use this switch.

-base
prepend a request URL comment and BASE tag to text/html outputs for -source
dumps.

-bibp=URL
specify a local bibp server (default http://bibhost/).

-blink
forces high intensity background colors for color mode, if available and
supported by the terminal. This applies to the slang library
(for a few terminal emulators), or to OS/2 EMX with ncurses.

-book
use the bookmark page as the startfile. The default or command line
startfile is still set for the Main screen command, and will be used
if the bookmark page is unavailable or blank.

-buried_news
toggles scanning of news articles for buried references, and converts them to
news links. Not recommended because email addresses enclosed in angle
brackets will be converted to false news links, and unencoded messages
can be trashed.

-cache=NUMBER
set the NUMBER of documents cached in memory. The default is 10.

-case
enable case-sensitive string searching.

-center
Toggle center alignment in HTML TABLE.

-cfg=FILENAME
specifies a Lynx configuration file other than the default lynx.cfg.

-child exit on left-arrow in startfile, and disable save to disk.

The lynx usage menu is available at the bottom of lynx browser. See an example picture below:

Lynx usage menu screenshot

Lynx will preview one page at a time. If you are viewing a large page, press space bar to view next page. You can also use Up and Down key to move the cursor but only to the next link. For example, when you press down key, it will move to the next link available in the page.

The left and right arrow key has a function too. The right key will open or follow a link. You can go back to previous page with left key. That's easy, isn't it? Ok, if you feel dizzy already with my explanation, press q and enter to quit lynx.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.