Searching Wikipedia on the Linux command line with wikit

search woman analyze inspect examine find research magnifying glass
Thinkstock.

Have you ever imagined looking up some topic on Wikipedia while you're working on the Linux command line? What about displaying the results in a different language? Yes, it's possible. In fact, it's quite easy. The tool that provides this service is calledwikit(Wikipedia IT).

To check ifwikitis installed on your system, just type "which wikit". If it is, you will get a response like this:

$ which wikit /usr/local/bin/wikit

If it's not, you can install it, but you might need to first installnodejswhichwikitdepends on and maybeNPM.as well with a command like one of these:

$ sudo apt install nodejs npm # Debian/Ubuntu $ sudo yum install nodejs npm # RHEL/CentOS $ sudo dnf install nodejs npm # Fedora

Installwikitusing a command like this:

$ sudo npm install wikit -g

To trywikitout, type "wikit" followed by the topic that you're interested in. For example:

$ wikit Idg International Data Group,Inc。(IDG)是一家注册和总部媒体,活动和研究公司专注于科技景观。成立于1964年,它由国际数据公司(IDC)和IDG Communications组成;后者包括品牌Cio Magazine,Computerworld,CSO,InfoWorld,Javaworld,MacWorld,NetworkWorld,PCWorld和Techhive。IDG是2017年中国海洋购买的,同时维持基于美国的领导力。

Some of the Wikipedia content is available in multiple languages. To get the response to the command shown above in French, for example, you could do this:

$ wikit --lang fr IDG IDG est un sigle qui peut signifier : * informatique de gestion ; * International Data Group, un groupe de presse américain ; * Indépendants de gauche, un groupe parlementaire sous la République française ; * Infrastructure de données géographiques, une organisation de partage d'informations géographiques ; * Initiative démocratique de gauche, un mouvement politique influant dans l'Aisne. IDG est un code qui peut signifier : *, Iowa, États-Unis, selon le code AITA des aéroports.

NOTE: To determine what letters to use to specify a particular language, visit this Wikipedia page withISO 639-1(codes for the representation of names of languages) codes.

Wikit will offer a list of possibly related topics if your search term appears ambiguous. This happens because this is the response that Wikipedia is providing. Wikit is simply passing your query to Wikipedia and delivering the results.

$ wikit idg ? Ambiguous results, "idg" may refer to: (Use arrow keys) ❯ IDG Ventures Apple Industrial Design Group Indigo Books and Music Makaziwe Mandela Australian Federal Police International Data Group Constant speed drive Indo-Germanic List of airports in Iowa Infinite derivative gravity

Some queries will require additional detail. For example, if we're look to find out something about a very small town in Virginia, we might need more detail than just the town's name:

$ wikit "Star Tannery" Star Tannery not found :^( $ wikit "Star Tannery, Virginia" Star Tannery is an unincorporated community in southwestern Frederick County, Virginia on the Shenandoah County line. Star Tannery is located on Star Tannery Road (State Route 604) off Wardensville Pike (State Route 55) along Cedar Creek. The Zip Code for Star Tannery is 22654.

Try to get relatively local information like this in another language and you'll probably find it isn't available.

美元wikit——朗德“明星制革厂, Virginia" Star Tannery, Virginia not found :^(

One of the benefits ofwikitis that you can pull reference information from Wikipedia and redirect it into a file that you're building. For example, you might try a script like this:

#!/bin/bash cat list | while read line do echo $line wikit "$line" done

要使用此脚本,您需要在“列表”文件中具有可识别的主题,每行一个主题。然后运行脚本,同时将其输出重定向到如下文件:

./getinfo > REPORT

Now see:

Join the Network World communities onFacebookLinkedInto comment on topics that are top of mind.
Related:

Copyright © 2020足球竞彩网下载

IT Salary Survey:结果是在