A Command Line Web Browsing with Lynx and Links Tools


Introduction

In today’s world, we rely heavily on graphical user interfaces (GUI) for web browsing, but there are still some situations where use of a command-line web browser may be necessary. Command-line web browsers can be useful in low-resource environments, remote servers, or when using a terminal interface. Lynx and Links are two of most popular command-line web browsers that offer a fast and efficient way of browsing web through terminal. In this article, we will discuss basics of Lynx and Links and demonstrate how to use them.

What is Lynx?

Lynx is a text-based web browser that allows users to browse web in a terminal environment. It was developed in 1992 and has been popular ever since. Lynx is open-source and available for various operating systems, including Linux, macOS, and Windows. It supports HTML, HTTPS, and FTP protocols, and can be used to access websites, download files, and browse directories.

How to Install Lynx?

Installing Lynx on Linux-based operating systems is quite simple, as it is usually included in default repositories. Open terminal and type in following command to install Lynx on Ubuntu −

sudo apt-get install lynx

For other Linux distributions, use package manager to install Lynx.

How to Use Lynx?

Once installed, open terminal and type lynx followed by URL of website you wish to visit. For example −

lynx https://www.wikipedia.org

This will open Wikipedia homepage in Lynx. Navigation is done through use of arrow keys, and Enter key is used to follow links. Pressing G key followed by URL will take you to a specific page.

Lynx can be customized through use of configuration files. default configuration file is located at /etc/lynx.cfg and can be modified to suit your needs.

What is Links?

Links is another text-based web browser that supports HTML, HTTPS, and FTP protocols. It was developed in 1999 and is open-source. Links is available for various operating systems, including Linux, macOS, Windows, and BSD. It is similar to Lynx in terms of functionality, but also offers some additional features such as tabbed browsing and support for JavaScript.

How to Install Links?

Installing Links is similar to Lynx. Open terminal and type in following command to install Links on Ubuntu −

sudo apt-get install links

For other Linux distributions, use package manager to install Links.

How to Use Links?

Using Links is similar to using Lynx. Open terminal and type links followed by URL of website you wish to visit. For example −

links https://www.wikipedia.org

This will open Wikipedia homepage in Links. Navigation is done through use of arrow keys, and Enter key is used to follow links. Pressing T key opens a new tab.

Links can also be customized through use of configuration files. default configuration file is located at /etc/links.cfg and can be modified to suit your needs.

Advantages of Lynx and Links

Lightweight

Lynx and Links are very lightweight and consume fewer resources compared to GUI-based web browsers.

Speed

Lynx and Links load web pages quickly due to their text-based nature.

Accessibility − Lynx and Links are accessible for people with visual impairments, as they rely on text instead of graphics.

Disadvantages of Lynx and Links

Limited functionality

Lynx and Links do not support some advanced features, such as multimedia content.

User interface

Lynx and Links have a steep learning curve, and users must become familiar with keyboard shortcuts Limited interactivity: Lynx and Links do not support interactive elements like forms or pop-ups.

Examples of using Lynx and Links

Browsing web

The most common use of Lynx and Links is to browse web. You can open either browser and type in URL of website you want to visit. For example, to visit Google's homepage in Lynx, type −

lynx https://www.google.com/

Similarly, to visit Google's homepage in Links, type −

links https://www.google.com/

Downloading files

You can use Lynx and Links to download files from internet. To download a file in Lynx, navigate to link using arrow keys and press D key. Lynx will prompt you to save file. In Links, you can download files by clicking on link and pressing Shift+D keys.

Viewing directory listings

Lynx and Links can be used to view directory listings on web servers. To do so, simply type in URL of directory. Lynx and Links will display directory listing in a text-based format.

Troubleshooting network issues

Lynx and Links can be used to troubleshoot network issues by testing connectivity to a web server. You can use ping command followed by URL of server to test if server is reachable. For example −

ping www.google.com

If server is reachable, you can then use Lynx or Links to browse website.

Conclusion

Lynx and Links are powerful command-line web browsers that offer a fast and efficient way of browsing web through terminal. They are particularly useful in low-resource environments, remote servers, or when using a terminal interface. Although they have some limitations, their lightweight and text-based nature make them accessible for people with visual impairments and provide quick access to information. With their simple yet powerful navigation, Lynx and Links are an excellent tool for anyone looking to browse web from command line.

Updated on: 19-Apr-2023

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements