Wikit, search Wikipedia from the terminal of your operating system

wikit name

In the next article we are going to take a look at Wikit. This is a small application that will allow us to search Wikipedia in a very comfortable way from the terminal of our Ubuntu operating system. As everyone knows today, Wikipedia has several million articles. The number of these is constantly increasing every day. It is the first place that comes to everyone's mind when looking for a particular piece of information.

With this simple utility for the command line called Wikit we will get access the summary of any Wikipedia article from the terminal of our system. As we all know by now, Wikipedia has a good collection of large and comprehensive articles that can get us out of more than one trouble.

If you're short on time and don't want to waste time reading a full Wikipedia article, you can use Wikit to get command-line Wikipedia summaries. To be exact, Wikit will display the first few paragraphs (the summary, of course) before the table of contents of a Wikipedia article.

We can take a look at the source code of this application from its page of GitHub.

Install Wikit on Ubuntu

Firstly, we will need to have NodeJS installed. I believe there is a version of NodeJS in the Ubuntu repositories. Once we have it installed, we will only have to execute the following command from the terminal (Ctrl + Alt + T) as root user or using sudo:

sudo npm install wikit -g

Once the installation is finished, we are going to go ahead and see how to use it in real time and get the information we want from Wikipedia. The typical syntax that we will use when using Wikit will be the following:

wikit < query > [-flags]

We can consult all the options that it makes available to the user in a simple way if we write the following command in the terminal:

wikit

How to use Wikit to get Wikipedia summaries from the terminal

We can use the indicators before or after the consultation. When we make multiple word queries, we can do them without the need to use quotation marks.

Let's look at the following example where we will find the article related to vi. To do this in our terminal (Ctrl + Alt + T) we will write the following:

wikit I saw

wikit vi

As seen in the previous screenshot, the command will show us the summary of the Wikipedia article that talks about vi.

This utility it will allow us to see the summary in other languages very simply. For example, the following command displays the summary of the specified wikipedia article in Spanish. We will only have to add to the command the specification of the requested language as seen in the following example:

wikit vi lang is

wikit -lang es vi

It may be the case, which I know there are, that the user does not like to read in the terminal. For this reason we will be able open a specific Wikipedia article in our default web browser. To do this from the terminal we will launch the following command:

wikit vi -b

The above command opens the Wikipedia page of vi in ​​your Web navigator predetermined. Here, we are going to use the -b flag so we can see the Wikipedia article in the browser.

As I have already said lines above, no need to enclose multi-word queries in quotes. So if we want to consult about Ubuntu Linux we can write something like the following in the terminal:

Ubuntu Linux Wikit

wikit ubuntu linux

As can be seen in the previous outputs, the utility will show us 80 characters per line. But this can be changed. We can increase or decrease the maximum number of characters per line using the -line parameter. If we wanted, for example, to set the line clipping length to 100 characters, we could do it using the following command:

wikit line 100

wikit -line 100 linux

uninstall

To eliminate this program from our system we will only have to open the terminal (Ctrl + Alt + T). In it we will only have to write the following order:

sudo npm uninstall wikit -g

Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.