Browsing websites from the command line has a niche following from seasoned Linux users. In the early days, users could access the websites from a terminal using text-only browsers like Lynx. At the time, most people used low-powered PCs with slow internet connections. Fast forward, Linux users are spoilt for choices with many modern GUI web browsers like Firefox, Chromium, Brave, or lightweight browsers like Midori, Otter. However, browsing from the terminal is still much practiced.
The article describes some of the best text-based web browsers and how to install them in your Linux distribution.
A text-based web browser displays the text content of a website. The majority of its niche community are seasoned Linux command line users who want to get everything done from the terminal. Text-based browsers provide faster loading and minimum bandwidth usage, which is great for low bandwidth connections. Another use case of command-line browsers is for system administrators who only interact with a terminal console.
Text-based web browsers for Linux command line usage
Without much further ado, let’s get into our list of the best open-source terminal web browsers.
w3m is a simple open-source text-based web browser for the terminal. An active version of the project is maintained by Tatsuya Kinoshita as the chief developer. w3m supports SSL connections, colors, and in-line images. The browser will render tables and even accept cookies. You can navigate web pages using a mouse. Moreover, it lets you view images on a page using an external program.
After you load a page, you can use keyboard arrow keys to navigate and press enter to take action. To quit, press SHIFT+Q, SHIFT+B to go back to the previous page, SHIFT + T to open a new tab, and SHIFT + U to open another URL. If you get stuck, you can type w3m in the terminal to get help or check out its repository at GitHub to interact with its community.
$ sudo apt install w3m w3m-img [Ubuntu/Debian]
The command will install the w3m package along with an image extension for in-line image support.
$ sudo dnf install w3m [Fedora]
To get started, type w3m followed by the URL of the website or the resource you want to access.
# w3m fosslinux.com
Lynx is an open-source, lightweight, text-based web browser. The project has been under development since 1992, making it one of the oldest web browsers available. It works well with a large community supporting its development and maintenance. Currently, Thomas Dickey is the chief maintainer and contributor of the project.
Lynx displays only the text part of a Web page and ignores images, video, etc. In essence, Web content is shown in the same way as seen by a search engine bot. As such, you can use it to test a website for any search-engine crawling problems. To get started, type the command lynx on a terminal prompt that displays different types of information and web content in different colors. For example, the ordinary text is displayed in white or violet, bold text in red, italic text in blue, hyperlinks in green, whereas currently highlighted hyperlinks in yellow.
The command-line utility loads fast and take less time to load a website than any GUI browser. It can come in handy in a situation when you have to do with a low-bandwidth Internet connection. You can open a website by typing lynx <website name> in the command line. Lynx is also conscious of users’ privacy. It does not track user information and doesn’t contain embedded tracking elements hidden in many web pages. It supports cookies but prompts you to allow or deny a cookie every time it loads a website.
Moreover, it can act as a text-to-speech application, or you can use it to view files and directories on your local system. You have to provide a name as an argument to the Lynx command. For example, to open the file (foss.tx), you can type lynx <i>foss</i>.txt.
If you are already intrigued, you will like that Lynx is highly configurable. You can use the ‘lynx -help’ command to get a list of more than 200+ configurable options to get the best out of your browser.
$ sudo apt-get install lynx [Debian, Mint & Ubuntu] $ sudo yum install lynx [RHEL, CentOS ] $ sudo dnf install lynx [Fedora] # zypper install links [suse & openSUSE] $ sudo pacman -S lynx [ArchLinux & Manjaro]
Links is an open-source text-based web browser that can also run in graphical mode. Its graphical mode can work on Unix systems without the X Window System. The first version was developed by Mikuláš Patočka. Since then, it has been forked into other projects like Elinks(Enhanced Links) and Hacked Links.
It features a pull-down menu system. It renders complex pages, supports color and monochrome terminals, supports horizontal scrolling, has partial HTML 4.0 support (including tables and frames), and supports multiple character sets [UTF-8]. It is ideal for scenarios where you want to retain many typical elements of graphical user interfaces like menus, pop-up windows, etc.
Links browser is available to install in distributions like Debian, Ubuntu, CentOS, Fedora, LinuxMint, openSUSE, ArchLinux, etc.
$ sudo apt-get install links [Debian, Mint & Ubuntu] $ sudo yum install links [RHEL, CentOS ] $ sudo dnf install links [Fedora] $ zypper install links [suse & openSUSE] $ sudo pacman -S links [ArchLinux & Manjaro]
To access a web page, type links followed by the URL of the website or the resource you want to access.
ELinks is an open-source text-based web browser and a fork from Links. It is a full-featured text-based web Browser that can render both frames and tables and is highly customizable. Moreover, you can extend its functionality via Lua or Guile scripts.
ELinks supports the use of a mouse to follow hyperlinks. Its menu system feature makes it stand out from other command-line browsers. If you press ESC on your keyboard, it displays a set of menus that let you enter and save URLs, add bookmarks, set up the browser, and many more.
Elinks is very portable and runs on a variety of platforms. It is bundled with all major Linux distributions.
$ sudo dnf install elinks [Fedora ] $ sudo apt-get install elinks [Debian, Mint & Ubuntu] $ sudo yum install elinks [RHEL, CentOS ] $ sudo zypper install elinks [suse & openSUSE] $ sudo pacman -S elinks [ArchLinux ]
To access a web resource, type elinks followed by the URL you want to access.
# elinks fosslinux.com
It features an elegant interface to type in the URL of the resource you are searching. Note that the display theme will depend on your terminal settings. Once you launch it in your terminal, press any key to bring the URL prompt or Q to quit.
$ sudo dnf install links2 [Fedora] $ sudo apt-get install links2 [Debian, Mint & Ubuntu] $ sudo yum install links2 [RHEL, CentOS] $ sudo zypper install links2 [suse & openSUSE] $ sudo pacman -S links2 [ArchLinux]
Note that browsh doesn’t work independently to render web pages but is a CLI front-end tool, which allows users to browse web pages. It uses headless Firefox to generate web pages. Therefore you have to make sure you have a recent version of Firefox installed on your system. In essence, whenever you request a web page or a resource, it loads a web page into headless Firefox, and custom scripts are injected into the Firefox page to convert the page for Browsh. Once the background processes are completed, the converted web pages will be loaded in Browsh.
Browsh developers offer RPM and DEB packages required to install Browsh in a Linux system.
RPM-based systems (RHEL, Fedora, CentOS)
# curl -o browsh.rpm -L https://github.com/browsh-org/browsh/releases/download/v1.6.4/browsh_1.6.4_linux_amd64.rpm # rpm -Uvh ./browsh.rpm # rm ./browsh.rpm # browsh
Debian based systems (Debian, Ubuntu)
# wget https://github.com/browsh-org/browsh/releases/download/v1.6.4/browsh_1.6.4_linux_amd64.deb # apt install ./browsh_1.6.4_linux_amd64.deb # rm ./browsh_1.4.12_linux_amd64.deb # browsh
# wget https://github.com/browsh-org/browsh/releases/download/v1.6.4/browsh_1.6.4_linux_amd64 # chmod +x browsh_1.6.4_linux_amd64 # ./browsh_1.6.4_linux_amd64
Once you install Browsh, you can start by typing the browsh command in your terminals.
Note that the only dependency of running Browsh in a recent 57 + version of Mozilla Firefox.
Netrik is an open-source text-based web browser for Linux. It is quite a simplistic web browser. It provides features like support for color, monochrome terminals, horizontal scrolling. But more importantly, it renders complex pages. Moreover, it understands most of HTML 4.01 and XHTML 1.0. It is designed to give you access to as much of the web as possible without limiting user comfort. Its priorities include a good user interface, innovative new features, and emphasis is on enhancing the advantages of text-mode browsing.
When you run it with the desired URL, the requested resource is loaded and displayed in the interactive mode in your terminal. It allows you to start browsing the web page or even a local HTML page or repository. However, it has limited functionality compared to other text-mode browsers like w3m or Lynx.
$ sudo apt-get install netrik [Debian, Mint & Ubuntu] # dnf install netrik [Fedora] # yum install netrik [RHEL, CentOS ] $ sudo pacman -S netrik [ArchLinux] # zypper install netrik [suse & openSUSE]
Text-based web browsers have a niche following from seasoned Linux terminal users who do almost everything from the command line or system administrators who work from a terminal window. If you are getting started, check out ELinks or w3m. In some scenarios, tools like curl and wget can come in handy when downloading files from the command line. Terminal-based web browsers can provide additional features and are good adjunct tools to add to your Linux collection.
Share any text-based browser we left out or your experience accessing the web using the command.