10 elinks command examples in Linux [Cheat Sheet]


CheatSheet

Reviewer: Deepak Prasad

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

If 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

Sample Output:

To exit the browser interface, press q and select Yes.

elinks to open local web files

 

2. Open remote URLs

Similarly, you can visit a remote website by specifying its URL. For example, to go to www.golinuxcloud.com, you can use the following command.

$ elinks www.golinuxcloud.com

Sample Output:

As you can see, it only displays the website in text format.

elinks to browse websites

You can use up and down arrow keys for navigation and press enter or right arrow key to open a hyperlink. The left arrow key takes you back to the previous page.

The left mouse button also opens a hyperlink. For more options, click right mouse button on the hyperlink.

elinks hyperlink options

To visit another website, you can press the g key. It will prompt you to enter the URL.

elinks go to 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

Sample Output:

Here, we are opening the directory /home/golinux.

browse local files and folders

 

4. Run on an anonymous account

The -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

Sample Output:

print elinks configuration file

 

7. Print help for configuration options

To get additional information about configuration options, you can use config-help.

$ elinks -config-help

Sample Output:

elinks configuration help options

 

8. Print plain-text versions of URLs to stdout

The -dump option is used to print a formatted plain-text version of URLs to stdout.

$ elinks -dump url

Sample Output:

elinks to print plain text versions of url

 

9. Look up the specified host

The -lookup option displays all DNS-resolved IP addresses of a given host.

$ elinks -dump url

Sample Output:

elinks to lookup specified host

 

10. Display the source form of URL

The -source option prints the source code of the URL.

$ elinks -source url

Sample Output:

print source code of url

To save the output in a file, you can use this command.

$ elinks -source www.ubuntu.com > file.html

 

Conclusion

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.

 

What's Next

15+ wget command examples in Linux [Cheat Sheet]
15+ ping command examples in Linux [Cheat Sheet]

 

Further Reading

man page for elinks command

 

Rohan Timalsina

Rohan Timalsina

He is proficient in a wide range of skills, including Page Builder Plugins such as Elementor, Beaver Builder, Visual Composer, and Divi Builder. His expertise extends to Front End Development with HTML5/CSS3, JavaScript, Bootstrap, and React.js. You can connect with him on his LinkedIn profile.

Can't find what you're searching for? Let us assist you.

Enter your query below, and we'll provide instant results tailored to your needs.

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can send mail to admin@golinuxcloud.com

Thank You for your support!!

Leave a Comment