Table of Contents
Introduction to elinks command
A text-mode browser is a type of web browser that displays only the text of websites without the graphic content. The web pages load faster and consume less bandwidth with text-only browsers.
Elinks is a popular text-mode browser in Linux. It supports colors, table rendering, background downloading, menu-driven configuration interface, tabbed browsing, and slim code.
You can use Elinks to browse through both local files and remote URLs. The main supported remote URL protocols are HTTP, HTTPS, and FTP.
How to install elinks
elinks is not installed by default in Linux. You can use the system package manager tool to get elinks.
Install elinks on CentOS, RHEL, Fedora
$ sudo dnf install elinks
Install elinks on Ubuntu and Debian
$ sudo apt install elinks
Syntax to use elinks command
The syntax for
elinks command is as follows:
$ elinks [option] URL
elinks is used without any arguments, it will prompt you to enter the URL.
Different examples to use elinks command
1. Open the local file
You can use the elinks command followed by the local HTML file to view the website.
$ elinks index.html
To exit the browser interface, press
q and select
2. Open remote URLs
Similarly, you can visit a remote website by specifying its URL. For example, to go to golinuxcloud.com, you can use the following command.
$ elinks www.golinuxcloud.com
As you can see, it only displays the website in text format.
You can use
down arrow keys for navigation and press
right arrow key to open a hyperlink. The
left arrow key takes you back to the previous page.
left mouse button also opens a hyperlink. For more options, click
right mouse button on the hyperlink.
To visit another website, you can press the
g key. It will prompt you to enter the URL.
3. Browse local files and folders
You can start elinks to open a local folder and browse files and folders in the system.
$ elinks local_folder
Here, we are opening the directory
4. Run on an anonymous account
-anonymous option allows you to run the browser in an anonymous mode. Some features like local file browsing, downloads, and modification of options are not allowed with this option.
$ elinks -anonymous url
5. Automatically submit the form to the URLs
You can use the
-auto-submit option to submit the first form available in the given URLs.
$ elinks -auto-submit url
6. Print a configuration file
This option prints the elinks configuration file with built-in default options to stdout.
$ elinks -config-dump
7. Print help for configuration options
To get additional information about configuration options, you can use
$ elinks -config-help
8. Print plain-text versions of URLs to stdout
-dump option is used to print a formatted plain-text version of URLs to stdout.
$ elinks -dump url
9. Look up the specified host
-lookup option displays all DNS-resolved IP addresses of a given host.
$ elinks -dump url
10. Display the source form of URL
-source option prints the source code of the URL.
$ elinks -source url
To save the output in a file, you can use this command.
$ elinks -source www.ubuntu.com > file.html
elinks is a great command-line tool for browsing websites in text mode. It is easy to use and provides features like table and frame rendering, color support, menu options, background downloads, FTP support, etc.
We hope this article helps you to understand how to use the elinks command in Linux. Feel free to ask any questions in the comment section.