Browsing the web from the Linux terminal

In some scenarios, you may want to browse websites from your Linux terminal. An example of these scenarios are when you have not an X-Window manager available or if you don’t have a good internet connection. When using 3G/4G or slow connections browsing websites from the terminal is a great option to increase speed and save bandwidth. This tutorial shows 4 terminal browsers: lynx, links, links2 and elinks.

Browsing the web from Linux terminal with lynx:

Let’s begin with the lynx console web browser, it is important to clarify this is the only terminal web browser in this article which doesn’t support mouse integration.

To begin installing the terminal web browser lynx, on Debian and based Linux distributions run:

# apt install lynx -y

Once installed using lynx is pretty easy, just call the program and specify the website you want to browse by running:

# lynx linuxhint.com

Despite lynx being simple, it isn’t as intuitive as it seems, instead of using the arrow keys from your keyboard to move from one place to other, use the SPACE key on your keyboard to move down and the B key to move up. When you reach the section, you want to browse into, just press ENTER.

If you want to go back to the previous page you can press your left arrow key on your keyboard, to go forward press the right arrow key on the keyboard.

By pressing the M key, you can go to the website homepage, a confirmation will be requested as shown in the screenshot below:

You can get more usage tips on lynx online at https://linux.die.net/man/1/lynx.

Browsing the web from Linux terminal with links:

Links is another great option to browse the web from the terminal, and it supports mouse integration.

To begin installing links terminal web browser on the terminal run:

# apt install links -y

Like with lynx and the rest of terminal web browsers call the program specifying the destination website with the following syntax:

# links linuxhint.com

The site will show up with a Welcome screen from links, press ENTER to close the welcome screen and get the website:

Press ENTER to OK and the website will show up:

As said previously, links supports mouse integration, if present, and you can use it to click on any section of the website you can to visit. As with Lynx, you can use the left arrow and right arrow keys on your keyboard to move a page back or a page forward.

By pressing the ESC key, you can display the main menu shown on the top of the screenshot below:

This main menu includes:

File: this menu includes the options go back, go forward, history, reload, bookmarks, new window, save as, save url as, save formatted document and kill background or all connections and flush the cache.

this submenu includes the options search, search backward, find next, find previous, toggle html/plain, document info, header info, frame at full-screen, save clipboard to a file, load clipboard from a file, html options and save html options.

Link: this submenu includes options follow link enter, open in new window and download link.

Downloads: here you are able to see the downloaded and downloading files.Setup:  here you are able to specify language, terminal options, margins, cache, options associated with mail and telnet, blocked images and additional options.

Help: this is the help submenu.

For links web browser you can visit https://linux.die.net/man/1/links.

Browsing the web from Linux terminal with links2:

As done with previous web browsers to install links2 on Debian based Linux distributions run:

# apt install links2

Then, once installed, on the terminal call the program specifying the website:

# links2 linuxhint.com

Then the shite will show up:

Like its predecessor links, links2 also supports mouse integration and the use of keys are the same for links and links2 including the ESC key to display the main menu bar.

There are more options available for links you can read at its man page: https://linux.die.net/man/1/links2.

Browsing the web from Linux terminal with Elinks:

Elinks is the last web browser of this article, to install it on the console run:

# apt install elinks -y

Then run it specifying the website as shown below:

# elinks linuxhint.com

Like with links and elinks, you can display a similar main menu on elinks by pressing the ESC key.

Elinks usage is similar, you can use the left and right keys on your keyboard to go back and forward, press ENTER on the item you can enter. Also elinks supports mouse integration like links and links2.

For elinks execution options visit: https://linux.die.net/man/1/elinks

I hope you found this tutorial on Browsing the web from Linux terminal useful. Keep following LinuxHint for more tips and updates.

About the author

Ivan Vanney

Ivan Vanney

Ivan Vanney has over 2 years as writer for LinuxHint, he is co-founder of the freelance services marketplace GIGopen.com where he works as a sysadmin.