Geek

How To Search And Use Wikipedia In Linux Terminal?

Wikipedia is like a vast trough of knowledge that often turns out to be useful in our daily lives. At many instances, Google pushes Wikipedia results towards the top in the search result pages to help you get the answers quickly. But, have you ever thought of using Wikipedia in terminal? It could be very handy for people who spend their days working on the console.

There exist a number of command line Linux utilities that you can use to search Wikipedia and get useful information. Some of these provide crisp summaries of articles and save your time. In case you’re a heavy WhatsApp user and you belong to India, you can also use this Wikipedia bot.

Some other terminal tricks that you will ❤️ :

Having said that, let’s tell you some simple ways to get your answers instantly and quench your thirst for knowledge:

Command line Wikipedia search using Wikit

Wikit command line program is my personal favorite way to get a summary of search topics from Wikipedia in the command line in no time. Here’s the GitHub link of Wikit.

According to Urban Dictionary, Wikit’s literal meaning is the act of looking up for something at Wikipedia.

Install Node.js

First and foremost, you need to install Node.js on your machine. To do so on your Ubuntu, Debian, or Mint systems, run the following command:

sudo apt-get install nodejs
sudo apt-get install npm

For other distros, use yum, pacman, or dnf package manager.

Installing Wikit

After installing Node.js, you need to run a simple command to install Wikit on your computer for using Wikipedia in terminal. Here’s how I did it on my Ubuntu machine:

sudo npm install wikit -g


How to use Wikit?

Once you’ve installed Wikit, using it to get Wikipedia summaries is pretty easy. Simply run the following command with your search query. Note that multi-word queries are also accepted and you don’t need to include quotes.

wikit <search query>


You can also use flags for getting a more precise output. The flags could be placed anywhere, before or after Wikipedia search query.

wikit <query> [-flags]

Here are the flags that you can use:

  • -b : Opens full Wikipedia article in browser.
  • -lang langCode : Specifies language; langCode is an HTML ISO language code.
  • line num : Sets line wrap length to num (minimum 15)
  • -d : Opens disambiguation page in browser.

You can also get complete information on Wikit by simply running following command:

wikit


Shown below are some examples of flag usage:

wikit -lang ja linux


The following command opened Manjaro Linux page in my web browser:

wikit -b manjaro

I hope that you would’ve loved learning about Wikit command which lets you use Wikipedia in Terminal. In case you know about some more cool terminal tools that can make the lives of fellow Fossbytes readers more interesting, don’t forget to share them with me.

To Top

Pin It on Pinterest

Share This