tty 的维基百科查看器

tty 的维基百科查看器

我想知道是否有任何命令可以在终端上获取维基百科条目的“介绍”(也许是全文)。

我发现本文很多文章都重定向到它,但不幸的是,当在控制台中运行它时,它给出:

$ dig +short txt fooba.wp.dg.cx
$

它带着代码退出0所以没有错误,但它也没有显示任何内容。

有没有 Linux 的 Wikipedia 查询命令。我使用 lynx 浏览互联网,但有时您只是想快速获取介绍并对其进行一些处理。

答案1

好吧,环顾四周:

$ apt search wikipedia              
Sorting... Done
Full Text Search... Done
libwww-wikipedia-perl/trusty 2.00-1 all
  perl module that provides an automated interface to Wikipedia

wikipedia2text/trusty,now 0.11-3 all [installed]
  displays Wikipedia articles on the command line

wikipediafs/trusty 0.4-5 all
  View and edit Wikipedia articles as if they were real files

看着的手册页wikepedia2text

-s        Display only the summary of the Wikipedia article.

-S        Display the full content of the  Wikipedia  article  and  not
          only the summary.

测试一下:

$ wikipedia2text -s Linux
Changes must be reviewed before being displayed on this page.show/hide details
This is the latest accepted revision, reviewed on 17 September 2015.
Jump to: navigation, search
This article is about the operating system. For the kernel (also often referred
to as just "Linux"), used in all variants of the Linux operating system, see
Linux kernel. For other uses, see Linux (disambiguation).

                                     Linux
Tux the penguin
Tux the penguin, mascot of Linux^
Developer Community
 Written  Primarily C and assembly
   in
OS family Unix-like
 Working  Current
  state
 Source   Mainly open source, proprietary software also available


$ wikipedia2text Linux   
Page protected with pending changes level 1

Linux

From Wikipedia, the free encyclopedia
Changes must be reviewed before being displayed on this page.show/hide details
This is the latest accepted revision, reviewed on 17 September 2015.
Jump to: navigation, search
This article is about the operating system. For the kernel (also often referred
to as just "Linux"), used in all variants of the Linux operating system, see
Linux kernel. For other uses, see Linux (disambiguation).

                                     Linux
Tux the penguin
Tux the penguin, mascot of Linux^
Developer Community
 Written  Primarily C and assembly
   in
OS family Unix-like
 Working  Current
  state
 Source   Mainly open source, proprietary software also available
  model
 Initial  1991; 24 years ago (1991)
 release
Marketing Personal computers, mobile devices, embedded devices, servers,
 target   mainframes, supercomputers
Available Multilingual
   in
          Alpha, ARC, ARM, AVR32, Blackfin, C6x, ETRAX CRIS, FR-V, H8/300,
Platforms Hexagon, Itanium, M32R, m68k, META, Microblaze, MIPS, MN103, Nios II,
          OpenRISC, PA-RISC, PowerPC, s390, S+core, SuperH, SPARC, TILE64,
          Unicore32, x86, Xtensa
 Kernel   Monolithic (Linux kernel)
  type
Userland  Various
Default
  user    Many
interface
 License  GPLv2^ and other free and open-source licenses, except for the
          "Linux" trademark^[a]

...

答案2

可以通过 Gopher 版本下载维基百科文章。

下面是使用 sed 提取文章的示例:

lynx -dump gopher://gopherpedia.com/0/sed | less -  

如果需要搜索文章,请转到主页:

lynx gopher://gopherpedia.com/1

或者直接搜索:

lynx gopher://gopherpedia.com/7/lookup 

相关内容