3种Linux 命令行中使用的Web 浏览器- 墨天轮

Dive into the Command Line: Exploring Web Browsers for Linux Terminals

In an era dominated by graphical web browsers like Chrome and Firefox, it's easy to forget the power and simplicity of text-based browsing. Back in the day, navigating the web often meant using a command-line interface (CLI) with tools like Lynx. While it might seem archaic, command-line web browsers are far from obsolete. They offer unique advantages, especially in specific scenarios. Let's explore three interesting web browsers that you can use in the Linux command line.

Why Use a Command-Line Web Browser?

Why would anyone choose a text-based browser over a modern GUI? Here are a few compelling reasons:

  • Resource Efficiency: Command-line browsers are incredibly lightweight, making them ideal for low-powered machines or situations where system resources are limited.
  • Speed on Slow Connections: When dealing with slow network connections, a text-based browser can provide a significantly faster browsing experience by avoiding the overhead of images and complex scripts.
  • Testing Website Accessibility: Developers can use these browsers to quickly check if a website is accessible and displays content correctly without relying on rendering engines.
  • Privacy Focused Browsing: Command-line browsers often offer a cleaner browsing experience, free from intrusive ads and tracking scripts that bog down modern browsers.
  • Command-Line Workflow: If you spend most of your time in the terminal, a command-line browser allows you to quickly access web-based information without switching to a graphical interface.

3 Linux Command-Line Browsers

Let's take a look at three command-line web browsers for Linux:

1. Links2: The Versatile Browser

Links2 positions itself as a graphical version of the classic Links browser. What sets it apart is its ability to operate in both text and graphical modes.

  • Text mode: When you type links2 followed by a URL in the command line, it displays a text-based version of the website.
  • Graphical mode: Using the command links2 -g opens the browser in a basic graphical interface.

Links2 supports features like frames and tables and even offers basic JavaScript support. You can also navigate using a mouse in both text and graphical modes.

2. ELinks: The Feature-Rich Text Browser

ELinks is another fork of the original Links browser. Similar to Links2, it supports tables, frames, and mouse-driven hyperlink navigation. However, one key difference is the lack of JavaScript support.

ELinks offers a unique menu system accessible by pressing the ESC key. This menu allows you to enter and save URLs, manage bookmarks, and configure browser settings. Although ELinks lacks a dedicated graphical mode, it can display images by using external applications like ImageMagick or GraphicsMagick. By clicking on an image placeholder or selecting it and pressing v, you can view the image in a separate window.

3. w3m: The Minimalist Powerhouse

w3m is a text based web browser as well as a pager. Upon launching w3m, it reminds of the classic Lynx browser. It supports mouse navigation, displays tables, and accepts cookies.

Like ELinks, w3m allows you to view images using external programs. Although it lacks JavaScript support, w3m excels at rendering web pages cleanly and with rich colors, even for complex layouts.

To learn w3m's keyboard shortcuts, simply press H while running the browser.

Conclusion

While graphical browsers dominate the web, command-line browsers are still valuable tools for specific tasks. Whether you need a resource-efficient browser for a low-powered system, want to browse the web without intrusive ads, or simply prefer the command line, Links2, ELinks, and w3m offer viable solutions.

By understanding the strengths and weaknesses of each browser, you can choose the one that best fits your needs and take a step back into the roots of the internet.

. . .
Generators