How to Access Wikipedia Without Ever Leaving the Linux Terminal

Hardcore Linux fans spend their lives on the command line. You can do just about anything from a terminal—to the extent that many don’t even bother installing a desktop environment.


But did you know that you can easily read Wikipedia summaries from the terminal? Here’s how.


wikit is a terminal-based Wikipedia summary reader

wikit is the brainchild of Kory Schneider and is described as “A command line utility for easily retrieving Wikipedia summaries”.

With a simple command along with some optional flags, Wikit pulls everything over the table of contents and displays it in your favorite terminal emulator. There is no need to open a browser or even have a browser installed. Or a GUI for that matter.

wikit is particularly useful when you have limited bandwidth, since opening a Wikipedia entry in a browser loads a lot of HTML along with several hundred kilobytes or even megabytes of images.

It’s also handy to read Wikipedia summaries in a terminal when connected to a Virtual Private Server or a Headless Raspberry Pi.

How to install and use Wikit

wikit relies on JavaScript and Node Package Manager, if you don’t already have them installed, run the following command for Debian-based systems:

sudo apt install nodejs npm

On Fedora-based machines:

sudo dnf install nodejs npm

For Red Hat-derived distributions:

sudo yum install nodejs npm

You should be aware that installing npm and JS requires a download of around 500MB.

Now you can use npm to install Wikit:

sudo npm install wikit -g

Using Wikit is easy, just type “wikit” followed by your search query. Multi-word queries do not require quotation marks. For example:

wikit eiffel tower

… gives the following output:

With you can change the line length of the output –Line Flag.

wikit eiffel tower 

…sets each output line to 72 characters.

If you are intrigued by the wikit summary and want to know more, add -b opens the full article in your default browser.

A full list of useful flags is available on the project’s GitHub page.

An easier way to read Wikipedia in the terminal

wikit certainly comes in handy when you just need a quick synopsis, and it certainly lives up to the Unix philosophy of doing one thing and doing it well.

But for many, a mere summary of a Wikipedia article isn’t enough, and they may loathe opening a desktop browser.

In this case, you can use a text-based terminal browser like Lynx to access and search Wikipedia directly.

Lynx is available in the standard repositories and may even come pre-installed on your system.

Type the following to use it:

lynx

…then press G before entering the URL.

Wikit satisfies your curiosity and keeps you busy

It’s easy to get distracted at work. An idle thought can catch your attention and demand gratification. Wikit means you can satisfy that craving for knowledge without straying too far from the task or opening a browser and risking the rabbit hole of Wikipedia link surfing.

Wikipedia remains a great source of knowledge, and if you’re determined to squander a day, there are tools to help you find great articles worth your time.

Leave a Reply

Your email address will not be published. Required fields are marked *